Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




define

define

(PHP3 , PHP4 )

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.



With any suggestions or questions please feel free to contact us