define in php

Solutions on MaxInterview for define in php by the best coders in the world

showing results for - "define in php"
Nicolò
22 Jan 2019
1//define() is used to create constants
2define(name,value);
3//here name has to be a string
4//here value can be string, integer, float, boolean or NULL, 
5//and can be an array to if you are using PHP 7.0+
6
7//define() before php 7.3
8define(name,value,case_insensitive);
9//case_insensitive is optional and can be TRUE or FALSE by default its false
Manuel
02 Jan 2018
1
2<?php
3
4 define("cars", [
5  "Alfa Romeo",
6  
7  "BMW",
8  "Toyota"
9]);
10echo cars[0];
11?>
12 
Clotilde
24 Jan 2017
1define("name", {value});