Re: function that appends dollar symbol
| From: | Robert Cummings | Date: | Sun, 23 Nov 2003 04:50:12 +0000 |
| Subject: | Re: function that appends dollar symbol | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170704@lists.php.net to get a copy of this message | ||
On Sat, 2003-11-22 at 23:35, John Nichel wrote:
> Joffrey Leevy wrote:
> > Hi all:
> >
> > The money_format function does not do it for me. Is
> > there a simple php function which appends the '$'
> > symbol to a string value. Example
> >
> > $money = 30
> > $money = some_php_function($money)
> > echo $money
> >
> > //should show $30
> >
> >
> > thanks
>
> How 'bout...
>
> $money = '$' . 30;
Hmmm, that's prepending... how about:
$money = 30.'$';
or if he wants it at the beginning:
$money = strrev( strrev( '30' ).'$' );
*heheh*
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'