i get some confused with one function i create on one array i get the correct result array and with other function the return result is object.
With that function the result is array :
public static function find_user_by_id ($user_id)
{
$result = self::find_this_query("SELECT * from users WHERE id = $user_id LIMIT 1");
$found_user_query_result = mysqli_fetch_array($result);
return $found_user_query_result;
}
but when i create a new function like below :
public static function find_user_by_id_new ($user_id)
{
$result_array = self::find_this_query("SELECT * from users WHERE id = $user_id LIMIT 1");
if (!empty($result_array)){
$first_item = array_shift($result_array);
return $first_item;
}
else{
return false;
}
}
the return is object?
What i make different and not get the same result ?