note 27300 deleted from function.print-r by aidan

From: Date: Mon, 11 Oct 2004 13:05:49 +0000
Subject: note 27300 deleted from function.print-r by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-78331@lists.php.net to get a copy of this message
Note Submitter: Michael McCallum ---- I liked the way coldfusion outputs a list of all the variables at the bottom of the page so I wrote a little script to reproduce it. Thought people might appreciate it... NOTE: you should correct the < br>. It contains an extra space because this page is not escaped properly. <? $variableSets = array( "Post:" => $HTTP_POST_VARS, "Get:" => $HTTP_GET_VARS, "Session:" => $HTTP_SESSION_VARS, "Cookies:" => $HTTP_COOKIE_VARS, "Server:" => $HTTP_SERVER_VARS, "Environment:" => $HTTP_ENV_VARS ); function printElementHtml( $value, $key ) { echo $key . " => "; print_r( $value ); echo "< br>"; } foreach ( $variableSets as $setName => $variableSet ) { if ( isset( $variableSet ) ) { echo "< br>< br><hr size='1'>"; echo "$setName< br>"; array_walk( $variableSet, 'printElementHtml' ); } } ?> kind regards Michael McCallum

« previous php.notes (#78331) next »