note 93806 added to function.array-walk-recursive

From: Date: Wed, 30 Sep 2009 14:51:13 +0000
Subject: note 93806 added to function.array-walk-recursive
Groups: php.notes 
Request: Send a blank email to php-notes+get-161171@lists.php.net to get a copy of this message
array_walk_recursive is handy for sanitizing the $_POST and $_GET superglobals to mitigate the threat of database injection attacks: <?php function sanitize(&$value, $key) { # The definition of this function is left as an exercise for the class } $post = $_POST; $get = $GET; array_walk_recursive($post, 'sanitize'); array_walk_recursive($get, 'sanitize'); ?> ---- Server IP: 87.124.86.41 Probable Submitter: 78.105.118.2 (proxied: 78.105.118.2) ---- Manual Page -- http://www.php.net/manual/en/function.array-walk-recursive.php Edit -- https://master.php.net/note/edit/93806 Del: integrated -- https://master.php.net/note/delete/93806/integrated Del: useless -- https://master.php.net/note/delete/93806/useless Del: bad code -- https://master.php.net/note/delete/93806/bad+code Del: spam -- https://master.php.net/note/delete/93806/spam Del: non-english -- https://master.php.net/note/delete/93806/non-english Del: in docs -- https://master.php.net/note/delete/93806/in+docs Del: other reasons-- https://master.php.net/note/delete/93806 Reject -- https://master.php.net/note/reject/93806 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#161171) next »