NYCPHP Meetup

NYPHP.org

[nycphp-talk] Mind exploded on this one!

Nunez, Eddy enunez at tiaa-cref.org
Fri Jul 11 15:27:41 EDT 2003


Not sure of the context of the question but here's my 2 cents...

By showing us these different arrays, I will assume you want to use
the arrays as reference points to the variable names stored as elements.
We could have some fun with this...
--------------------------------
$hasSelectedLetter = 'this letter';
$letter = 'not that but this letter!';

print $x = $arrayListArray[0];
print $x = eval("return \$$x"."[0];");
print $$x; 

print $y = $arrayListArray[3];
print $y = eval("return \$$y"."[1];");
print $$y;

Output:
booleanNonFormVars
hasSelectedLetter
this letter
profileNonFormVarArray
letter
not that but this letter!
-----------------------------------
I wish there was something syntactically correct yet intuitive to allow 
us to use something like:
$hasSelectedLetter value ~~  $$($$($$arrayListArray[0])[0])
$letter 		 value ~~  $$($$($$arrayListArray[3])[0])
Looks very PERLsh, iick.  Oh well, the PHP parser would choke on this
instantly.

Hope this turns on a light bulb or two.

-Eddy

 -----Original Message-----
From: Phil Powell [mailto:soazine at erols.com]
Sent: Friday, July 11, 2003 2:22 PM
To: talk at lists.nyphp.org; php-general at lists.php.net
Subject: [nycphp-talk] Mind exploded on this one!


$booleanNonFormVars = array('hasSelectedLetter', 'hasEnteredProfile',
'hasSelectedProfile',
                             'hasEditedProfile', 'hasDeletedProfile',
'willDeleteProfile',
                             'willDeletePic');
 $booleanVars = array('profileID', 'showemail', 'showbirthday', 'season',
'profilememberid');
 $profileVarArray = array('firstname', 'lastname', 'city', 'state',
'country', 'favebands',
                          'faveconcert', 'favescandinavia', 'faveviking',
'favemeat',
                          'freetime', 'thingslove', 'thingshate',
'favebibleverse',
                          'changeonething', 'maritalstatus', 'birthday',
'favemovie', 
                          'faveplace', 'favetv', 'imgpath', 'imgext');
 $profileNonFormVarArray = array('profileName', 'letter', 'name');

 $arrayListArray = array('booleanNonFormVars', 'booleanVars',
'profileVarArray', 
                        'profileNonFormVarArray');

Bluntly put, I need to get: 
$hasSelectedLetter
$letter

Etc..

I have absolutely NO idea how to do this, help!

Phil


**************************************************************
This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law.  If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies.  You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.
TIAA-CREF
**************************************************************




More information about the talk mailing list