note 64120 added to function.preg-replace

From: Date: Fri, 07 Apr 2006 20:13:24 +0000
Subject: note 64120 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-107544@lists.php.net to get a copy of this message
If you have a form element displaying the amounts using "$" and ",". Before posting it to the db you can use the following: $search = array('/,/','/\$/'); $replace = array('',''); $data['amount_limit'] = preg_replace($search,'',$data['amount_limit']); ---- Server IP: 66.163.161.117 Probable Submitter: 209.208.183.66 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- http://master.php.net/note/edit/64120 Del: integrated -- http://master.php.net/note/delete/64120/integrated Del: useless -- http://master.php.net/note/delete/64120/useless Del: bad code -- http://master.php.net/note/delete/64120/bad+code Del: spam -- http://master.php.net/note/delete/64120/spam Del: non-english -- http://master.php.net/note/delete/64120/non-english Del: in docs -- http://master.php.net/note/delete/64120/in+docs Del: other reasons-- http://master.php.net/note/delete/64120 Reject -- http://master.php.net/note/reject/64120 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#107544) next »