Re: note 11924 added to function.substr-replace.php
| From: | Jesus M. Castagnetto | Date: | Tue, 13 Mar 2001 23:13:46 +0000 |
| Subject: | Re: note 11924 added to function.substr-replace.php | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-12367@lists.php.net to get a copy of this message | ||
See also: number_format() for a much simpler solution
Will add the comment above to your note.
--- jgainey@infoave.net wrote:
> 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
>
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-notes-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
--- Jesus M. Castagnetto <jmcastagnetto@php.net>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/