Bug #2104: ereg_replace doesn't work with $

From: Date: Wed, 18 Aug 1999 16:26:20 +0000
Subject: Bug #2104: ereg_replace doesn't work with $
Groups: php.dev 
Request: Send a blank email to php-dev+get-9982@lists.php.net to get a copy of this message
From: craig@starpoint.net Operating system: Unix/Solaris 2.5 PHP version: 3.0.12 PHP Bug Type: Misbehaving function Bug description: ereg_replace doesn't work with $ My web form allows users to put in a dollar value which goes into a MySql database. We want to remove any $ sign in the submitted value before sending it the database. The command: ereg_replace("$","",$value) doesn't appear to have any affect. I change the command to: ereg_replace("#","b",$value) and submit #5555 I get: b5555 if I replace the command with ereg_replace("$","b",$value) and submit $5555 I get $5555b. it behaves like the $ anchor. I tried these also, they produce the same results: ereg_replace("\$","b",$value) ereg_replace(chr(36),"b",$value) Of course I don't want the 'b' I want it to work like, ereg_replace("$","",$value)

« previous php.dev (#9982) next »