On Fri, Oct 22, 2010 at 1:05 AM, Micky Hulse <mickyhulse.li...@gmail.com>wrote:

> Hi,
>
> I must be tired because I can't figure this out... I am sure it is
> something obvious.
>
> I need to pass a hex value to a method, but I can't figure out how to
> convert a hex string to a hex value.
>
> For exmaple:
>
> $base = '96989b'
> my_method('0x' . $base)
>
> The above does not work with my_method().
>
> my_method(0x96989b)
>
> The above works without any problems.
>
> Any tips?
>
> Many thanks in advance!
>
> Micky
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi Micky,

I suspect the issue is the conversion from string to a number in your
example:
http://www.php.net/manual/kr/language.types.string.php#language.types.string.conversion

In your second example, you're directly inputing a hex number, so there's no
issue.

Hope you get some rest :)

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com

Reply via email to