[nycphp-talk] array in object
dirn at dirnonline.com
Wed Jan 21 20:38:11 EST 2009
I would guess that $key['descr'] is happening before $cur->$key.
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Rick Retzko
Sent: Wednesday, January 21, 2009 8:24 PM
To: talk at lists.nyphp.org
Subject: [nycphp-talk] array in object
Hi Folks -
This should be simple, but I haven't been able to debug it on my own, so I'm
asking for help.
I'm walking through a user's webform submission that I've put into an object
and comparing each of that object's properties with the current properties
($cur) stored on mySQL database.
The example below is input for a phone number (phone1).
This example stores the 10-digit phone number into variable $c:
If I use $key to capture the property to be checked ('phone1'), the
following stores null:
Any help on understanding why $cur->$key['descr'] is not synonymous with
$cur->phone1['descr'] when $key='phone1' would be a help!
Best Regards -
rick at click-rick.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the talk