Re: Re: int to string
| From: | Tanner Postert | Date: | Thu, 06 Apr 2006 00:12:50 +0000 |
| Subject: | Re: Re: int to string | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233312@lists.php.net to get a copy of this message | ||
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@ridersite.org> 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
>
>