Hello please help me out regarding returning the variable from the function
I am return three variable from the function likw this
return $data
return $success
return $error
calling from
$check =$user->search($result);
now to put some condition according to the variable received .The problem i am facing is that how can i get the name of the vairable which i have received . i want to receive it by name not by value
like
if($check == $data )
returncan only return a single thing, and it “aborts” the function, so you cannot have 2 or more returns in a row – only the first one would ever execute. So, the workaround is to return a container which contains all the values you need. In this case, i’ve used an array, but return can “return” anything – you could have an object passed back if you’d like.