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”;

}

About

me : yeay its me arun

Tagged with: , , ,
Posted in PHP, Programming

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>