Re: defined() function broke?
| From: | Andy Warwick | Date: | Fri, 06 Oct 2000 11:31:59 +0000 |
| Subject: | Re: defined() function broke? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18859@lists.php.net to get a copy of this message | ||
on 6/10/00 12:03 pm, KOYAMA Tetsuji at koyama@hoge.org wrote:
>
> At Fri, 06 Oct 2000 10:37:41 +0100,
> Andy Warwick <andy.w@unit5.co.uk> wrote:
>>
>> I'm having problems with using the defined() function to check if a constant
>> is defined.
>>
>> The following program:
>>
>> <?php
>> echo "FOO defined: ".defined(FOO)."<br>Value: ".FOO;
>> define("FOO", "snafu");
>> echo "<br><br>FOO defined: ".defined(FOO)."<br>Value:
>> ".FOO;
>
> The paramater of defined() is name of constant as string. In this
> case, 'defined("FOO")' is correct.
Thanks; that works fine.
Thought it might be something stupid and obvious :)
--
Andy Warwick
andy.w@unit5.co.uk http://www.unit5.co.uk
Unit 5 Digital, 11 Ashling Court, Trent Bridge, Nottingham NG2 3JA
t: +44 (0)115 986 5281 f: +44 (0)115 986 5715