PHP: define - Manual in Deutsh
PHP: define - Manual in French
PHP: define - Manual in Polish

You Are At PHP: define - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

define

(PHP 3, PHP 4, PHP 5)

define -- Defines a named constant

Description

bool define ( string name, mixed value [, bool case_insensitive] )

Defines a named constant at runtime.

Parameters

name

The name of the constant.

value

The value of the constant.

case_insensitive

If set to TRUE, the constant will be defined case-insensitive. The default behaviour is case-sensitive; i.e. CONSTANT and Constant represent different values.

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example 1. Defining Constants

<?php
define
("CONSTANT", "Hello world.");
echo
CONSTANT; // outputs "Hello world."
echo Constant; // outputs "Constant" and issues a notice.

define("GREETING", "Hello you.", true);
echo
GREETING; // outputs "Hello you."
echo Greeting; // outputs "Hello you."

?>

See Also

defined()
constant()
The section on Constants

Karma pedigree - Najlepsza dla twojego zwierzaka
fotograf ślubny lublin
raty
forma spółki
Wykaz informacyjny dodaj stronę

Another Useful functions:


zend-macro.zend-define-property | language.variables.predefined | language.constants.predefined | function.swf-definetext | function.swf-definerect | function.swf-definepoly | function.swf-defineline | function.swf-definefont | function.swf-definebitmap | function.runkit-method-redefine | function.runkit-function-redefine | function.runkit-constant-redefine | function.pdf-define-layer | function.ocidefinebyname | function.oci-define-by-name | function.ncurses-define-key | function.get-defined-vars | function.get-defined-functions | function.get-defined-constants | function.defined | function.define | function.define-syslog-variables | function.classkit-method-redefine | function.apc-define-constants |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.