Forside > PHP > PHP Variables and Constants

PHP: Variables and Constants

By Kristoffer Bohmann

Basic Data Types

Numbers

abc

Strings

abc

Booleans

abc

Dynamic Typing

abc

Variable Scope

Included files

Functions (and Global / Local / Static variables)

Passing by Reference

Global Variables

See also: $_POST, $_GET

Constants

define("HELLO", "Hello world.<br>", true);
echo HELLO; // outputs "Hello world."

if(HELLO) { echo "HELLO exist.<br>"; }
if(!defined("HELLO2")) { echo "HELLO2 does not exist."; }

include HELLO . "/path/to/file.php";