Re: array to var - with different name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 array variables.
However, you can also look at the extract() function. It won't do
exactly what you want, but it will pull the array keys/values into the
current symbol table. Use with caution (note the second parameter to the
function).

Paul


Well, It occurs to me that you can't code in PHP without getting use to dealing with arrays. ;-)

I just much rather like typing:
<input name="f_email" value="<?PHP if (isset($t_email)) { print htmlspecialchars($t_email);} ?>" />

Instead of:
<input name="f_email" value="<?PHP if (isset($_GET['f_email'])) { print htmlspecialchars($_GET['f_email']);} ?>" />

or

if ($t_ok) {

}

instead of:
if ($_GET['f_ok']) {

}

Save's a lot of typing time as far as I can tell.

Donovan





--
D Brooke

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux