AgerNic.com
Start write and run your php code online
HOME Editor | PHP Exemples | PHP Functions |
WEB TEMPLATES | EXAMPLES
PHP Tutorial
PHP define() function, run and write PHP code.

PHP define() function - online editor.

The define() php function defines a constant. This function returns true on success or false on failure.
Syntax:
define(name,value,case_insensitive);

Example :
define () - returns true on success or false on failure.
  <?php
define("GREETINGS","Hi to you! Nice day today?");
echo constant("GREETINGS"); // outputs "Hi to you! Nice day today?""

echo "<br /><br />";
define("CONSTANT", "Hello Europe.");
echo CONSTANT; // outputs "Hello Europe."
echo "<br />";
echo Constant; // outputs "Constant" and issues a notice.

echo "<br /><br />";

define("GREETING", "Hi to you.", true);
echo GREETING; // outputs "Hi to you."
echo "<br />";
echo Greeting; // outputs "Hi to you."
echo "<br /><br />";
// Works as of PHP 7
define('animals', array('Dog', 'Cat', 'Monkey'));
echo animals[1]; // outputs "Cat"

?>


Tags:
PHP define() function 7

PHP define() function

PHP Functons
PHP count() Function

PHP define() function

PHP empty() Function

PHP explode() function

PHP html_entity_decode() function

PHP htmlentities() function

PHP htmlspecialchars_decode() function

PHP htmlspecialchars() function

PHP implode() function

PHP isset() Function

PHP lcfirst() function

PHP ltrim() function

PHP md5() function

PHP print() function

PHP printf() function

PHP rtrim() function

PHP similar_text() function

PHP str_repeat() function

PHP str_replace() function

PHP str_split() function

PHP strcmp() function

PHP strip_tags() function

PHP strlen online function

PHP strrchr() Function

PHP strstr() function

PHP strtolower() function

PHP strtoupper() function

PHP substr() function

PHP trim() function

PHP ucfirst() function