note 91341 modified in function.filter-var-array by danbrown

From: Date: Mon, 08 Jun 2009 12:40:14 +0000
Subject: note 91341 modified in function.filter-var-array by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156456@lists.php.net to get a copy of this message
<?php //an example of simply sanitize an array.. $data = array( '<b>bold</b>', '<script>javascript</script>', 'P*}i@893746%%%p*.i.*}}|.dw<?php echo "echo works!!";?>'); $myinputs = filter_var_array($data,FILTER_SANITIZE_STRING); var_dump($myinputs); //OUTPUT: //formarray(3) { [0]=> string(4) "bold" [1]=> string(10) "javascript" [2]=> string(26) "P*}i@893746%%%p*.i.*}}|.dw" } ?> --was-- //an example of simply sanitize an array.. $data = array( '<b>bold</b>', '<script>javascript</script>', 'P*}i@893746%%%p*.i.*}}|.dw<?php echo "echo works!!";?>'); $myinputs = filter_var_array($data,FILTER_SANITIZE_STRING); var_dump($myinputs); //OUTPUT: //formarray(3) { [0]=> string(4) "bold" [1]=> string(10) "javascript" [2]=> string(26) "P*}i@893746%%%p*.i.*}}|.dw" } http://php.net/manual/en/function.filter-var-array.php

« previous php.notes (#156456) next »