PHP stała () Funkcja
Przykład
Zwróć wartość stałej:
<?php
//define a constant
define("GREETING","Hello you! How are you today?");
echo constant("GREETING");
?>
Definicja i użycie
Funkcja Constant() zwraca wartość stałej.
Uwaga: Ta funkcja działa również ze stałymi klas.
Składnia
constant(constant)
Wartości parametrów
Parameter | Description |
---|---|
constant | Required. Specifies the name of the constant to check |
Szczegóły techniczne
Wartość zwrotu: | Zwraca wartość stałej lub NULL, jeśli stała nie jest zdefiniowana |
---|---|
Wersja PHP: | 4+ |
❮ PHP Różne odniesienia