PHP- Konstante () Funktion
Beispiel
Gibt den Wert einer Konstante zurück:
<?php
//define a constant
define("GREETING","Hello you! How are you today?");
echo constant("GREETING");
?>
Definition und Verwendung
Die Funktion constant() gibt den Wert einer Konstante zurück.
Hinweis: Diese Funktion funktioniert auch mit Klassenkonstanten.
Syntax
constant(constant)
Parameterwerte
Parameter | Description |
---|---|
constant | Required. Specifies the name of the constant to check |
Technische Details
Rückgabewert: | Gibt den Wert einer Konstante oder NULL zurück, wenn die Konstante nicht definiert ist |
---|---|
PHP-Version: | 4+ |
❮ Verschiedene PHP-Referenzen