note 70047 deleted from function.preg-replace by colder

From: Date: Mon, 18 Jun 2007 20:04:06 +0000
Subject: note 70047 deleted from function.preg-replace by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127705@lists.php.net to get a copy of this message
Note Submitter: norten at gmail dot com ---- In Hungary we use the "," character to separate the integer and the fraction part of numbers. This little script replaces all "," between two numbers to the English-style ".": <?php $text = "The result is 23,3 m."; $text = preg_replace("/([0-9])([,])([0-9])/","$1.$3",$text); print $text; //output: The result is 23,3 m. ?>

« previous php.notes (#127705) next »