note 100302 added to function.var-export

From: Date: Wed, 06 Oct 2010 20:57:56 +0000
Subject: note 100302 added to function.var-export
Groups: php.notes 
Request: Send a blank email to php-notes+get-173039@lists.php.net to get a copy of this message
Try this function instead of var_export($GLOBALS) or var_dump($GLOBALS) when all you want to know is the values of the variables you set on the current page. function globalvars(){ $result=array(); $skip=array('GLOBALS','_ENV','HTTP_ENV_VARS', '_POST','HTTP_POST_VARS','_GET', 'HTTP_GET_VARS', '_COOKIE', 'HTTP_COOKIE_VARS','_SERVER', 'HTTP_SERVER_VARS', '_FILES','HTTP_POST_FILES', '_REQUEST','HTTP_SESSION_VARS', '_SESSION'); foreach($GLOBALS as $k=>$v) if(!in_array($k,$skip)) $result[$k]=$v; return $result; }//functionglobalvars var_export(globalvars()); ---- Server IP: 64.71.164.2 Probable Submitter: 76.169.152.105 ---- Manual Page -- http://www.php.net/manual/en/function.var-export.php Edit -- https://master.php.net/note/edit/100302 Del: integrated -- https://master.php.net/note/delete/100302/integrated Del: useless -- https://master.php.net/note/delete/100302/useless Del: bad code -- https://master.php.net/note/delete/100302/bad+code Del: spam -- https://master.php.net/note/delete/100302/spam Del: non-english -- https://master.php.net/note/delete/100302/non-english Del: in docs -- https://master.php.net/note/delete/100302/in+docs Del: other reasons-- https://master.php.net/note/delete/100302 Reject -- https://master.php.net/note/reject/100302 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#173039) next »