RE: [PHP] removing and item out of a string

From: Date: Tue, 06 Mar 2001 18:59:10 +0000
Subject: RE: [PHP] removing and item out of a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-42792@lists.php.net to get a copy of this message
what about preg_replace("(\d),(\d)", "$1$2",$your_string); to replace every occurence of a comma surrounded by digits? This works with 4.04, prior to that the "replace" string would by "\\1\\2". Doug | -----Original Message----- | From: Brian C. Doyle [mailto:doyleb@corp.earthlink.net] | Sent: Tuesday, March 06, 2001 12:08 PM | To: php-general@lists.php.net | Subject: [PHP] removing and item out of a string | | | Hello all, | | I need to remove a comma from inside of 2 quotes ie | "1,234.56" I need to | change that to "1234.56" | Unfortunatly I can not do reg_replace(",","","1,234.56"); | This is inside a csv file. | | | | Brian C. Doyle | Coach Team Force | Earthlink Technical Support | support@mindspring.com |

« previous php.general (#42792) next »