PHP gedefinieerd() Functie
Voorbeeld
Controleer of er een constante bestaat:
<?php
define("GREETING","Hello you! How are you today?");
echo defined("GREETING");
?>
Definitie en gebruik
De functie defined() controleert of er een constante bestaat.
Syntaxis
defined(name)
Parameterwaarden
Parameter | Description |
---|---|
name | Required. Specifies the name of the constant to check |
Technische details
Winstwaarde: | Retourneert TRUE als de constante bestaat, of FALSE anders |
---|---|
PHP-versie: | 4+ |
❮ PHP overige referentie