Re: Str to Int

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

 



You probably want to do an is_int() first...

After that, you know it's an int and treat it that way. Why do you need to
typecast it?

BTW, change $cardID = $HTTP_GET_VARS[cardID]; to $cardID = $_GET['cardID'];
for PHP5 compatibility... ;-)

Gerry

On 1/20/06, Ron Eggler (Paykiosks) <ron@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I need to do a type cast from string to int in folllowing code:
> [php]
> <getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
> [/php]
> I need $cardID have converted to int. I thought it should work that way
> but it does not!
> But it's working if I'm putting
> [php]
> <getPIN cardID="180" quantity="1" />
> [/php]
> in there. I got card ID as a var that is passed as get like:
> [php]
> $cardID = $HTTP_GET_VARS[cardID];
> [/php]
>
> Can anyone help me in that issue? Thank you!
>
> __________________________________________
>
> Ron Eggler
> Intern
> 866-999-4179
> www.paykiosks.net
>
>
>
>


--
Gerry
http://portal.danen.org/

[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