NYCPHP Meetup

[nycphp-talk] ${$variable}

Michael Southwell southwell at dneba.com
Wed Aug 27 17:04:01 EDT 2003


wow, you guys are fabulous (and I thought this was going to be simple)!

Jeff Siegel, this looks like another likely candidate.


At 04:40 PM 8/27/2003, you wrote:
>Okay folks, here's the scoop. Based on some extensive testing at
>http://chxo.com/scripts/emptytest.php
>
>To test for an empty string, you have to test that it is both empty AND a 
>string.
>
>if ( is_string($$foo) && empty($$foo) ) do empty string stuff here
>
>Otherwise $$foo could be 0 or not set at all. I humbly take back any 
>misinfo I spread earlier, Michael.
>
>     chris.
>
>Michael Southwell wrote:
>
>>A line of code says this:
>>   if (!(${$foo})) do something if the value is empty
>>
>>If $foo="bar" and $bar="something" then will ${$foo} evaluate to 
>>"something"--which I assume is the purpose of the curly brackets?  But it 
>>doesn't seem to work when the value is empty, though I would swear it 
>>used to.  or maybe there is something with an empty value evaluating true 
>>anyway, so I need to use =="" or ==="", or =='' or ==='' (single 
>>quotation marks)?  Is this tricky, or am I just ignorant?
>>
>>Michael G. Southwell =================================
>>DNEBA Enterprises
>>81 South Road
>>Bloomingdale, NJ 07403-1419
>>973/492-7873 (voice and fax)
>>southwell at dneba.com
>>http://www.dneba.com
>>======================================================
>>
>>
>>_______________________________________________
>>talk mailing list
>>talk at lists.nyphp.org
>>http://lists.nyphp.org/mailman/listinfo/talk
>
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk

Michael G. Southwell =================================
DNEBA Enterprises
81 South Road
Bloomingdale, NJ 07403-1419
973/492-7873 (voice and fax)
southwell at dneba.com
http://www.dneba.com
======================================================





More information about the talk mailing list