Jump to content

php function to convert "FF" to "255"?


michaellunsford

Recommended Posts

[url=http://uk2.php.net/hex2dec]hex2dec[/url] should set you on your way ;)
you'll just have to note that each pair in the 6 character hex string amounts to a number, so you will (as far as i know, unless there's another specific function) have to split it up first into 3 parts and then perform the hex2dec conversions. the user notes on the php manual hex2dec page does bring up the subject of converting colours though.

cheers
Link to comment
Share on other sites

[quote author=redbullmarky link=topic=123189.msg508862#msg508862 date=1169247668]
[url=http://uk2.php.net/hex2dec]hex2dec[/url] should set you on your way ;)
you'll just have to note that each pair in the 6 character hex string amounts to a number, so you will (as far as i know, unless there's another specific function) have to split it up first into 3 parts and then perform the hex2dec conversions.

cheers
[/quote]
In fact, most of the comments on that page deal with this topic.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.