I need to change my status to words in the method, but when I pass the argument as a string to the method, I get the result from both conditions:
public static function Status($status)
{
if ($status == true || $status == True || $status == 'true' || $status == 'True' || $status == 1)
{
echo "true";
}
if ($status == false || $status == False || $status == 'false' || $status == 'False' || $status == 0)
{
echo "false";
}
}
When I pass the value "False" as a string for the method, I get the result truefalse, but I have no problem with string values.
source
share