Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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'));
?>
Comment

php constant

<?php
define("PI",3.14);
echo PI;
echo constant("PI");
?>
Comment

PHP constants

//define(name,value);

define("PI",3.1419); 
Comment

PHP constant

class Human {
  const TYPE_MALE = 'm';
  const TYPE_FEMALE = 'f';
  const TYPE_UNKNOWN = 'u'; // When user didn't select his gender
  
  .............
}
Comment

Constants In PHP

<?php
define("A", 100);
define("B", 200);
echo A;
echo "<br>";
echo B;
?>
Comment

PHP Constants

<?php
define("GREETING", "Welcome to my profile");
echo GREETING;
?>
Comment

PREVIOUS NEXT
Code Example
Php :: pre function for PHP 
Php :: add hour minute in datetime in php 
Php :: Flutter migrate to Android Studio mac os 
Php :: random digit with seed php 
Php :: how to use postgresql with laravel 
Php :: percentage in php 
Php :: php loop object 
Php :: @include laravel 
Php :: mac os down upgrade php 
Php :: how to convert array to string in php 
Php :: lluminate/contracts[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 - your php version (8.0.10) does not satisfy that requirement. 
Php :: laravel remove foreign key 
Php :: separate numbers with commas laravel 
Php :: calculate 18 years back date in php 
Php :: print try catche errors 
Php :: php get parameter 
Php :: laravel asset 
Php :: laravel get items by ids 
Php :: laravel collection transform 
Php :: drupal load all nodes of type 
Php :: dompdf with qr code 
Php :: php exception import 
Php :: remove all sessions in laravel 
Php :: how to send data from one website to another in php 
Php :: push key and value in laravel 
Php :: duplicate record laravel 
Php :: sanctum auth check? 
Php :: laravel save photo in both local and database 
Php :: eloquent with select 
Php :: php timezone 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =