PHP Constructs


PHP Language Constructs

PHP has many built-in language constructs and functions. Language constructs can be used with or without parentheses while functions always have parentheses. Here is an example using a language construct. With brackets: require_once('filename.php') Without Brackets: require_once 'filename.php'

Here is a list of several PHP constructs which will be used quite frequently in even the simplest PHP / mySQL applications.

Printing strings and variables
echo()
print()

Unsetting a session variable
unset()

Check is a variable is set
isset()

Check if post variable is empty
empty()

Check if post variable is not empty
!empty

Include files:
include()
include_once()
require()
require_once()

End the php script
die() or die