★ wanayoo — archive 1999 http://fr.php.net/manual/function.define.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Misc.
Quick Reference
English version of this pageGerman version of this pageJapanese version of this page
Italian version of this pageFrench version of this pageHungarian version of this page
Spanish version of this pageDutch version of this pageBrazilian Portuguese version of this page
Korean version of this pageCzech version of this page
Misc.
* connection_aborted
* connection_status
* connection_timeout
* define
* defined
* die
* eval
* exit
* get_browser
* highlight_file
* highlight_string
* ignore_user_abort
* iptcparse
* leak
* pack
* show_source
* sleep
* uniqid
* unpack
* usleep

  Thanks to:
 Chek.com
 easyDNS
 VA Linux Systems

  Related sites:
Apache
MySQL
PostgreSQL
Zend Tech.

  Community:
LinuxFund.org
OSDN
Manual: define
View the source code for this pageSearch the site



Previous page
 connection_timeout
 Updated
Mon, 08 Jan 2001
defined 
Next page


define

(PHP 3, PHP 4 )

define -- Defines a named constant.

Description

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

Defines a named constant, which is similar to a variable except:

  • Constants do not have a dollar sign '$' before them;

  • Constants may be accessed anywhere without regard to variable scoping rules;

  • Constants may not be redefined or undefined once they have been set; and

  • Constants may only evaluate to scalar values.

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 1 is given, then the constant will be defined case-insensitive. The default behaviour is case-sensitive; i.e. CONSTANT and Constant represent different values.

Example 1. Defining Constants


<?php
define ("CONSTANT", "Hello world.");
echo CONSTANT; // outputs "Hello world."
?>
      

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

See also defined() and the section on Constants.


 About Notes


Previous page
 connection_timeout
 Updated
Mon, 08 Jan 2001
defined 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
France
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.