You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, but I can't figure out how to assign a value to a variable that is outside a callback function.
$need_var = 0;
$redis->get('key', function ($result) use ($need_var) {
var_dump($result); // example in my case display int(2)
$need_var = $result; // did't work
});
var_dump($need_var); // int(0)
The text was updated successfully, but these errors were encountered:
Sorry, but I can't figure out how to assign a value to a variable that is outside a callback function.
The text was updated successfully, but these errors were encountered: