> -----Original Message-----
> From: Wendell Brown [mailto:[EMAIL PROTECTED]
> Sent: 28 May 2003 15:02
>
> On Wed, 28 May 2003 12:46:50 +0100, David Grant wrote:
>
> >I would've thought that $HTTP_*_VARS will be deprecated
> sometime in the
> >future. It might be an idea to write your own accessor methods, e.g.
> >
> >function RetrieveGetParameter($parameterValue)
>
> Egads! Wouldn't the following be a little simpler?
>
> At the top of the file put.....
>
> if( is_array($_POST) )
> $pArray = $_POST;
> else
> $pArray = $HTTP_POST_VARS;
>
> Then access $pArray["fred"] where ever you want to? And yes, I know
> this creates a second copy of the post array in local memory
Only if you actually change any of the elements -- otherwise, PHP does
what's called a _shallow_copy_, which doesn't actually copy all the values
unless it becomes necessary.
> (wouldn't
> pointers be nice right about now)
Well, how about references, then? (And me, personally, I'd use isset()
rather than is_array().)
if (isset($_POST)):
$POST = &$_POST;
else:
$POST = &$HTTP_POST_VARS;
endif;
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php