I'm using PHP in my project and when any form is submitted I need to check if the input it not empty, so I use something like this:
if(empty($myVar)) {
echo "Error";
} else {
echo "success";
}
But this doesn't seem to be working as I want, so If the user enter empty space like " " so between the quotation is nothing but emptiness, but still PHP showing success message instead of error message.
I used isset($var) also, but its the samething, not working as I need.
What could be the problem? and How to solve it?