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

You Are At PHP: constant - 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

constant

(PHP 4 >= 4.0.4, PHP 5)

constant -- Returns the value of a constant

Description

mixed constant ( string name )

Return the value of the constant indicated by name.

constant() is useful if you need to retrieve the value of a constant, but do not know its name. I.e. it is stored in a variable or returned by a function.

This function works also with class constants.

Parameters

name

The constant name.

Return Values

Returns the value of the constant, or NULL if the constant is not defined.

Examples

Example 1. constant() example

<?php

define
("MAXSIZE", 100);

echo
MAXSIZE;
echo
constant("MAXSIZE"); // same thing as the previous line

?>

See Also

define()
defined()
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.copy-constructor | zend-api.zval-update-constant | zend-api.zend-update-class-constants | zend-api.zend-u-register-constant | zend-api.zend-u-get-constant | zend-api.zend-register-stringl-constant | zend-api.zend-register-string-constant | zend-api.zend-register-long-constant | zend-api.zend-register-double-constant | zend-api.zend-register-constant | zend-api.zend-get-constant | zend-api.zend-declare-class-constant | zend-api.zend-declare-class-constant-stringl | zend-api.zend-declare-class-constant-string | zend-api.zend-declare-class-constant-long | zend-api.zend-declare-class-constant-double | zend-api.zend-declare-class-constant-bool | zend-api.register-stringl-constant | zend-api.register-string-constant | zend-api.register-main-stringl-constant | zend-api.register-main-string-constant | zend-api.register-main-long-constant | zend-api.register-main-double-constant | zend-api.register-long-constant | zend-api.register-double-constant | streams.constants | reserved.constants | migration52.global-constants | migration52.class-constants | language.oop5.constants | language.oop.constructor | language.constants.predefined | language.constants | internals.pdo.constants | http.constants | function.xsl-xsltprocessor-construct | function.tidy-construct | function.swish-construct | function.swfvideostream.construct | function.swftextfield.construct | function.swftext.construct | function.swfsprite.construct | function.swfsound.construct | function.swfshape.construct | function.swfprebuiltclip.construct | function.swfmovie.construct | function.swfmorph.construct | function.swfgradient.construct | function.swffont.construct | function.swfbutton.construct | function.swfbitmap.construct | function.swfaction.construct | function.soap-soapvar-construct | function.soap-soapserver-construct | function.soap-soapparam-construct | function.soap-soapheader-construct | function.soap-soapfault-construct | function.soap-soapclient-construct | function.simplexml-element-construct | function.sdo-model-reflectiondataobject-construct | function.sdo-das-relational-construct | function.sammessage-constructor | function.samconnection-constructor | function.runkit-constant-remove | function.runkit-constant-redefine | function.runkit-constant-add | function.pharfileinfo-construct | function.phar-construct | function.pdo-construct | function.ming-useconstants | function.httprequestpool-construct | function.httprequest-construct | function.httpquerystring-construct | function.httpmessage-construct | function.httpinflatestream-construct | function.httpdeflatestream-construct | function.harudoc-construct | function.get-defined-constants | function.dom-domxpath-construct | function.dom-domtext-construct | function.dom-domprocessinginstruction-construct | function.dom-domimplementation-construct | function.dom-domentityreference-construct | function.dom-domelement-construct | function.dom-domdocument-construct | function.dom-domcomment-construct | function.dom-domattr-construct | function.directoryiterator-construct | function.constant | function.bcompiler-write-constant | function.arrayobject-construct | function.apc-load-constants | function.apc-define-constants | curl.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.