// takes an array and desired key value and returns an array// searches through an array for a given key, if found the key that row is made the first row and the other rows are inserted accordingly.// the facility of this function is to get the value with a specific key of an array as the first value.