note 11924 added to function.substr-replace.php

From: Date: Tue, 13 Mar 2001 17:29:32 +0000
Subject: note 11924 added to function.substr-replace.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-12342@lists.php.net to get a copy of this message
I had a situation in which I needed to add a comma to the third position of a number(the price of something). <p> $price = "12000";<br> $price = substr_replace ($price, ',', -3, 0)";<br> the result would be 12,000<p> the -3 counts from right to left. a regular 3 would count from left to right I hope this helps... http://www.php.net/manual/en/function.substr-replace.php

« previous php.notes (#12342) next »