NYCPHP Meetup

NYPHP.org

[nycphp-talk] Mind exploded on this one!

Phil Powell soazine at erols.com
Fri Jul 11 15:36:23 EDT 2003


IN that case, Eddy, how about this, THIS works:

$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');

 // COMPACT ARRAYS INTO 2-DIMENSIONAL ARRAY arrayListArray
 $arrayListArray = compact('booleanNonFormVars', 'booleanVars', 'profileVarArray', 
                        'profileNonFormVarArray');

 // I COULD NOT POSSIBLY EVER EXPLAIN THIS.. ASK HANS ZAUNERE OF NY PHP TO EXPLAIN IT FOR YOU
 foreach ($arrayListArray as $key => $val) {
  for ($j = 0; $j < sizeOf($val); $j++) {
   if (preg_match('/^boolean/', $key) && strlen(${$val[$j]}) == 0) ${$val[$j]} = 0;
   if (!preg_match('/^boolean/', $key) && strlen(${$val[$j]}) == 0) ${$val[$j]} = '';
  }
 }

Phil
  ----- Original Message ----- 
  From: Nunez, Eddy 
  To: 'NYPHP Talk' 
  Sent: Friday, July 11, 2003 3:33 PM
  Subject: RE: [nycphp-talk] Mind exploded on this one!


  Sorry but...
  this won't work because 'hasSelectedLetter' and 'letter' aren't array keys 
  they're just values in the arrays.

  -Eddy

  -----Original Message-----
  From: Jon Baer [mailto:jonbaer at jonbaer.net]
  Sent: Friday, July 11, 2003 3:23 PM
  To: NYPHP Talk
  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



  **************************************************************
  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
  **************************************************************



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


  _______________________________________________
  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/2ef5cdad/attachment.html>


More information about the talk mailing list