Re: function trouble: pass by referrence

From: Date: Mon, 21 Jan 2002 22:18:45 +0000
Subject: Re: function trouble: pass by referrence
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-81443@lists.php.net to get a copy of this message
where ever you are going to referance $HTTP_POST_VARS use $GLOBALS[HTTP_POST_VARS] and then use that inside your function. function myFunc() { foreach($GLOBALS[HTTP_POST_VARS] AS $k => $i) { $GLOBALS[HTTP_POST_VARS][$k] = stripslashes($i); $GLOBALS[HTTP_POST_VARS][$k] = strip_tags($i); } } and after this function $GLOBALS[HTTP_POST_VARS] will look like you want it to. Jim Lucas bend.com ----- Original Message ----- From: "Bryan McCloskey" <b_mccloskey2000@yahoo.com> To: <php-general@lists.php.net> Sent: Monday, January 21, 2002 2:19 PM Subject: [PHP] function trouble: pass by referrence > Hello all, > > I'm trying to pass the $HTTP_POST_VARS array into a > function to run some things like strip_tags, trim, and > htmlspecialchars on all of the variables. If possible, > I would like to pass this array by referrence, and > have the function make changes to the actual array and > not a copy. Accomplishing this is giving me fits, > however. Can anyone help? > > -bryan > > ===== > -------------------------------------------------------------------------- - > Schrodinger may have slept here. > -------------------------------------------------------------------------- - > > __________________________________________________ > Do You Yahoo!? > Send FREE video emails in Yahoo! Mail! > http://promo.yahoo.com/videomail/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#81443) next »