PHP MYSQL Tips and Tricks
This is a small article containing tricks and tips I aquired by reading PHP 6 Text Book.
I was used isset() function to check whether these arguements are set or not. And also I need to check this is empty or not.
Here is another function to check both of this requirement at single line.
empty()
It checks if a variable has an empty value: an empty string, 0, NULL,or FALSE.
Example
if ( !empty($_POST[‘name’]) && !empty($_POST[‘comments’]) && !empty($_POST[‘email’]) ) {
echo “Yes”;
}