This issue is simple, but I am not sure what is the best approach to get around it.
If the variable contains a number, how can I make sure that the if statement only returns true if indeed the $some_var
is one?
you need to use 3 equals
if($some_var ===1){
here is more info http://php.net/manual/en/language.operators.comparison.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With