NYCPHP Meetup

NYPHP.org

[nycphp-talk] Mind exploded on this one!

Phil Powell soazine at erols.com
Fri Jul 11 15:26:51 EDT 2003


I got it, but I bet you guys will slam 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 = compact('booleanNonFormVars', 'booleanVars', 'profileVarArray', 
                        'profileNonFormVarArray');


 foreach ($arrayListArray as $key => $val) {
  for ($j = 0; $j < sizeOf(${$key}); $j++) {
   if (preg_match('/^boolean/', $key) && strlen(${${$key}[$j]}) == 0) ${${$key}[$j]} = 0;
   if (!preg_match('/^boolean/', $key) && strlen(${${$key}[$j]}) == 0) ${${$key}[$j]} = '';
  }
 }

Sorry, it's the best I could do

Phil
  ----- Original Message ----- 
  From: Jon Baer 
  To: NYPHP Talk 
  Sent: Friday, July 11, 2003 3:23 PM
  Subject: Re: [nycphp-talk] Mind exploded on this one!


  echo $booleanNonFormVars['hasSelectedLetter'];
  echo $profileNonFormVarArray['letter'];

  - jon

  pgp key: http://www.jonbaer.net/jonbaer.asc
  fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47


    ----- Original Message ----- 
    From: Phil Powell 
    To: talk at lists.nyphp.org ; php-general at lists.php.net 
    Sent: Friday, July 11, 2003 11:21 AM
    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


----------------------------------------------------------------------------


    _______________________________________________
    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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030711/df593acd/attachment.html>


More information about the talk mailing list