Re: Re: int to string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



number range is relatively small... i'll just make an array, and reference
it by index;

$INT2STRING = array(
1=> "One",
2=>"Two",
30 = "Thirty");

Then reference it by:

print ($x ."=". $INT2STRING[$x]);


should work just fine.  just wondering if there was an easier solution.
thanx for the help though.

On 4/5/06, Al <news@xxxxxxxxxxxxx> wrote:
>
> Tanner Postert wrote:
> > I don't think it's built in, so I was wondering ya'll would recommend as
> the
> > best way to convert int to string, not basic type casting, but
> converting to
> > the english word the int represents.
> >
> > Something like this:
> >
> > 5 = "Five" or 20 = "Twenty"
> >
> What is your number range?  1...20 or what?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux