Answers for "php define constant"

PHP
-1

php const

<?php
    define('CONSTANT', 'Hello world !');
    const CONSTANT = 'Hello world !';
    const NEW_CONSTANT = CONSTANT.' And beyond...';
    const ANIMALS = array('dog', 'cat', 'ant');
    define('ANIMALS', array('dog', 'cat', 'ant'));
?>
Posted by: Guest on March-16-2021
0

php constant name with variable

echo constant($constant_name);
Posted by: Guest on July-06-2021
1

php define constant

<?php
 define("GREETING", "Constant value ");
echo GREETING;
?>
Posted by: Guest on August-24-2021
0

php constant

<?php
define("PI",3.14);
echo PI;
echo constant("PI");
?>
Posted by: Guest on September-03-2021
0

PHP constant

class Human {
  const TYPE_MALE = 'm';
  const TYPE_FEMALE = 'f';
  const TYPE_UNKNOWN = 'u'; // When user didn't select his gender
  
  .............
}
Posted by: Guest on September-08-2021

Browse Popular Code Answers by Language