php - Checking a boolean after returning a boolean from a function -
i utterly confused: why won't method of function work?
i have slight problem, not sure coming though, i'd check first if if statements cause, yet in java if(var){ //var true } works, yet in php, seems more complex understanding of booleans.
i attempting check if boolean true after getting return true; function i've used in check.
some of code this.
if: if($user->uservalidmc($_post['username']) === true function:
public function uservalidmc($user){ // grab data $minecraftoutput = file_get_contents('https://www.minecraft.net/haspaid.jsp?user=' . $user . ''); return $minecraftoutput; } am checking wrong, or code wrong (the function)?
the remote service returns string, either 'true' or 'false', return value should be:
return trim($minecraftoutput) === 'true';
Comments
Post a Comment