Predefined Constants PHP_VERSION _OS _EOL _PREFIX _BINDIR

Php has lots of predefined constants, Here in this post I am writing about very few constants and there sample output.

[code]
// the use of come special php predefined constants.
echo PHP_VERSION.PHP_EOL;
echo PHP_OS.PHP_EOL;
echo PHP_PREFIX;
echo PHP_EOL;
echo PHP_BINDIR;
echo PHP_EOL;
echo PHP_CONFIG_FILE_PATH;
echo PHP_EOL;
echo PATH_SEPARATOR;
?>
OUTPUT
5.2.5
Linux
/usr
/usr/bin
/etc/httpd
:
[/code]

If you simply look at the constants and there output line by line then you can understand there uses easily , its really straight forward.

List of other constants
http://in.php.net/reserved.constants

0 comments:

Post a Comment

Post your helpful suggestions on this...

 
 
 

typo3 cms templates tutorial

PHP news

php freelancer mumbai India