note 84326 added to function.filter-var
| From: | dale dot liszka at gmail dot com | Date: | Wed, 09 Jul 2008 16:54:17 +0000 |
| Subject: | note 84326 added to function.filter-var | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141315@lists.php.net to get a copy of this message | ||
Using the FILTER_CALLBACK requires an array to be passed as the options:
<?php
function toDash($x){
return str_replace("_","-",$x);
}
echo
filter_var("asdf_123",FILTER_CALLBACK,array("options"=>"toDash"));
// returns 'asdf-123'
?>
----
Server IP: 208.69.120.35
Probable Submitter: 216.248.11.38
----
Manual Page -- http://www.php.net/manual/en/function.filter-var.php
Edit -- https://master.php.net/note/edit/84326
Del: integrated -- https://master.php.net/note/delete/84326/integrated
Del: useless -- https://master.php.net/note/delete/84326/useless
Del: bad code -- https://master.php.net/note/delete/84326/bad+code
Del: spam -- https://master.php.net/note/delete/84326/spam
Del: non-english -- https://master.php.net/note/delete/84326/non-english
Del: in docs -- https://master.php.net/note/delete/84326/in+docs
Del: other reasons-- https://master.php.net/note/delete/84326
Reject -- https://master.php.net/note/reject/84326
Search -- https://master.php.net/manage/user-notes.php