Re: [PHP] array to var - with different name

2011-01-21 Thread Donovan Brooke
Donovan Brooke wrote: [snip] if ($t_ok) { } Small correction.. with my established naming convention.. the above ideally would be: > if ($b_ok) { > > } D -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array to var - with different name

2011-01-21 Thread Donovan Brooke
Paul M Foster wrote: [snip] Shawn, I don't know if I have a good reason, other than I rather like working with string vars instead of array vars from $_REQUEST for (sticky forms and conditionals). I can check/verify them as well in the process. You should probably get used to dealing with the a

Re: [PHP] array to var - with different name

2011-01-20 Thread Paul M Foster
On Thu, Jan 20, 2011 at 05:29:01PM -0600, Donovan Brooke wrote: [snip] > > > Shawn, I don't know if I have a good reason, other than I rather like > working with string vars instead of array vars from $_REQUEST for > (sticky forms and conditionals). I can check/verify them as well in the > pro

RE: [PHP] array to var - with different name

2011-01-20 Thread Tommy Pham
> -Original Message- > From: Donovan Brooke [mailto:li...@euca.us] > Sent: Thursday, January 20, 2011 3:29 PM > Cc: php-general@lists.php.net > Subject: Re: [PHP] array to var - with different name > > Tommy Pham wrote: > [snip] > >> foreach ($_REQUEST a

Re: [PHP] array to var - with different name

2011-01-20 Thread Donovan Brooke
Tommy Pham wrote: [snip] foreach ($_REQUEST as $key => $value) $$key = $value; short-circuited one-liners :) Regards, Tommy akk... wrong clicked before I had a chance to fix the code. anyway, foreach ($_GET as $key => $value) if (substr($key, 0, 2) == 'f_') ${'t_'.substr($key, 2)} = $valu

Re: [PHP] array to var - with different name

2011-01-20 Thread Tommy Pham
On Thu, Jan 20, 2011 at 3:09 PM, Tommy Pham wrote: > On Thu, Jan 20, 2011 at 2:28 PM, Donovan Brooke wrote: >> Hello again! >> >> I'm trying to find a good way to convert array key/value's to >> variable name values... but with the caveat of the name being >> slightly different than the original k

Re: [PHP] array to var - with different name

2011-01-20 Thread Tommy Pham
On Thu, Jan 20, 2011 at 2:28 PM, Donovan Brooke wrote: > Hello again! > > I'm trying to find a good way to convert array key/value's to > variable name values... but with the caveat of the name being > slightly different than the original key > (to fit my naming conventions). > > first, I (tediousl

Re: [PHP] array to var - with different name

2011-01-20 Thread Daniel Molina Wegener
On Thursday 20 January 2011, Donovan Brooke wrote: > Hello again! > > I'm trying to find a good way to convert array key/value's to > variable name values... but with the caveat of the name being > slightly different than the original key > (to fit my naming conventions). > > first, I (tediousl

[PHP] array to var - with different name

2011-01-20 Thread Donovan Brooke
Hello again! I'm trying to find a good way to convert array key/value's to variable name values... but with the caveat of the name being slightly different than the original key (to fit my naming conventions). first, I (tediously) did this: --- if (isset($_GET['f_action'])) { $t_action =