Home >>PHP String Functions >PHP empty() function
PHP empty() function checks whether a variable holds some value or not.
Eg
<?php if(isset($_GET['sub'])) { if(empty($_GET['n'])) { echo "fill your name first"; } else { echo "welcome ".$_GET['n']; } } ?> <form> Enter your name<input type="text" name="n"/> <input type="submit" name="sub" value="show my name"/> </form>