Join Up!
104879 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousconstantdefinednext
Last updated: Tue, 28 May 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | German | Spanish

define

(PHP 3, PHP 4 >= 4.0.0)

define -- Defines a named constant.

Description

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

Defines a named constant. See the section on constants for more details.

The name of the constant is given by name; the value is given by value.

The optional third parameter case_insensitive is also available. If the value TRUE is given, then the constant will be defined case-insensitive. The default behaviour is case-sensitive; i.e. CONSTANT and Constant represent different values.

Esimerkki 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."

?>

define() returns TRUE on success and FALSE if an error occurs.

See also defined(), constant() and the section on Constants.

User Contributed Notes
define
add a note about notes
There are no user contributed notes for this page.
previousconstantdefinednext
Last updated: Tue, 28 May 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST