There is no better or worse.  The new superglobals 
were introduced in PHP 4.1.0.  Use them how you wish.  

Also consider extract() and/or import_request_variables().  
Personally I like:

  import_request_variables('gpc', 'r_');

Which in your example would result in:

  print $r_var;

But it depends, going through predefined variables 
everytime can be fun too.

Regards,
Philip Olson

On Thu, 23 May 2002, Tyler Longren wrote:

> Hi,
> 
> Just to prevent a bunch of non-helpful e-mails, I've already RTMF!
> 
> Now, to the point.  When using the new variables in php 4.2.x, how should I
> go about handling my variables?
> 
> Should I just _print "$_GET[var]"_ every time I need to print $var to the
> screen, or would it be better to just do this in an include file or at the
> top of every page:
> $var = $_GET[var];
> 
> Thanks!
> tyler
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

Reply via email to