473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

convert integers to hex

Is there a built-in PHP function that lets you convert integers to
hexadecimal values?
For example 255 to FF.

Couldn't find any in the manual.

..soma
Dec 23 '05 #1
4 2353
somaboy mx wrote:
Is there a built-in PHP function that lets you convert integers to
hexadecimal values? [...] Couldn't find any in the manual.


couldn't find? How is that possible?
http://www.google.com/search?q=hexad...te:www.php.net

--
E. Dronkert
Dec 23 '05 #2
"somaboy mx" <no****@fakemail.fk> wrote in message
news:do**********@domitilla.aioe.org...
Is there a built-in PHP function that lets you convert integers to
hexadecimal values?
For example 255 to FF.
Yes there is, dechex().
Couldn't find any in the manual.


Have you ever seen a movie called Barry Lyndon? There's this beautiful scene
right in the beginning, this is how the dialogue goes:

Nora: "I have hidden my neck ribbon somewhere on my person. If you find it,
you can have it. You are free to look anywhere for it. I will think little
of you if you do not find it."
Barry: "I cannot find it."
- "You haven't looked properly."
- "I cannot find it."
- "I'll give you a hint."
- "I feel the ribbon."
- "Why are you trembling?"
- "At the pleasure of finding the ribbon."
- "Liar."

Nora hid the ribbon between her breasts. Barry looked for it only from her
hands, failing to find it. as Nora says "I'll give you a hint", she takes
Barry's hand to here bosom, and Barry eventually finds the ribbon.

In a way, you resemble Barry, who was so reluctant to look for the answer
while it was practically right under his nose. Was it courtesy, shyness or
plain stupidity? We shall never know. If you get a chance to watch Barry
Lyndon, I recommend you to do so, it is a masterpiece by Stanley Kubrick.

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
an*******************@gmail.com.NOSPAM.invalid
Dec 23 '05 #3
Kimmo Laine wrote:
"somaboy mx" <no****@fakemail.fk> wrote in message
news:do**********@domitilla.aioe.org...
Is there a built-in PHP function that lets you convert integers to
hexadecimal values?
For example 255 to FF.


Yes there is, dechex().
Couldn't find any in the manual.


Have you ever seen a movie called Barry Lyndon? There's this beautiful
scene right in the beginning, this is how the dialogue goes:

Nora: "I have hidden my neck ribbon somewhere on my person. If you find
it, you can have it. You are free to look anywhere for it. I will think
little of you if you do not find it."
Barry: "I cannot find it."
- "You haven't looked properly."
- "I cannot find it."
- "I'll give you a hint."
- "I feel the ribbon."
- "Why are you trembling?"
- "At the pleasure of finding the ribbon."
- "Liar."

Nora hid the ribbon between her breasts. Barry looked for it only from her
hands, failing to find it. as Nora says "I'll give you a hint", she takes
Barry's hand to here bosom, and Barry eventually finds the ribbon.

In a way, you resemble Barry, who was so reluctant to look for the answer
while it was practically right under his nose. Was it courtesy, shyness or
plain stupidity? We shall never know. If you get a chance to watch Barry
Lyndon, I recommend you to do so, it is a masterpiece by Stanley Kubrick.


LOL. :-)

Kimmo, that is the funniest version of the famous RTFM I ever saw. :-)

Erwin Moller
Dec 23 '05 #4
"Erwin Moller"
<si******************************************@spam yourself.com> kirjoitti
viestissä:43***********************@news.xs4all.nl ...
Kimmo Laine wrote:
"somaboy mx" <no****@fakemail.fk> wrote in message
news:do**********@domitilla.aioe.org...
Is there a built-in PHP function that lets you convert integers to
hexadecimal values?
For example 255 to FF.


Yes there is, dechex().
Couldn't find any in the manual.


Have you ever seen a movie called Barry Lyndon? There's this beautiful
scene right in the beginning, this is how the dialogue goes:

Nora: "I have hidden my neck ribbon somewhere on my person. If you find
it, you can have it. You are free to look anywhere for it. I will think
little of you if you do not find it."
Barry: "I cannot find it."
- "You haven't looked properly."
- "I cannot find it."
- "I'll give you a hint."
- "I feel the ribbon."
- "Why are you trembling?"
- "At the pleasure of finding the ribbon."
- "Liar."

Nora hid the ribbon between her breasts. Barry looked for it only from
her
hands, failing to find it. as Nora says "I'll give you a hint", she takes
Barry's hand to here bosom, and Barry eventually finds the ribbon.

In a way, you resemble Barry, who was so reluctant to look for the answer
while it was practically right under his nose. Was it courtesy, shyness
or
plain stupidity? We shall never know. If you get a chance to watch Barry
Lyndon, I recommend you to do so, it is a masterpiece by Stanley Kubrick.


LOL. :-)

Kimmo, that is the funniest version of the famous RTFM I ever saw. :-)

RTFM is just so impersonal... :)
--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <an*******************@gmail.com.NOSPAM.invalid>
Dec 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Lawson | last post by:
I know how to conver a string to an array of strings, but I need to convert an ascii string to an array of integers (really unsigned chars). Eg, $str ="ABC"; needs to convert to something...
13
by: Hako | last post by:
I try this command: >>> import string >>> string.atoi('78',16) 120 this is 120 not 4E. Someone can tell me how to convert a decimal number to hex number? Can print A, B, C,DEF. Thank you.
30
by: John Carroll | last post by:
Does anyone have a function or procedure for converting integers to character strings? Thank you, John
24
by: djozy | last post by:
Please, how can I convert selected item from dropdown list to integer? Thank you
4
by: John A Grandy | last post by:
Often in dbs , tinyint is used instead of int (because tinyint cols may be indexed , whereas int cols may not). What is the best way to convert integers to booleans ? The following fails: ...
8
by: csanjith | last post by:
Hi, i have a situaion where i need to convert the characters entered in an text field to upper case using C. The configuration id utf8 environment in which user can enter any character (single ,...
11
by: redefined.horizons | last post by:
I'm still pretty new to Python. I'm writing a function that accepts thre integers as arguments. I need to divide the first integer by te second integer, and get a float as a result. I don't want...
4
by: meendar | last post by:
Hi, I am having a character pointer which contains ascii values. i just want to convert all these ascii values to respective characters and again store it in another character pointer. ...
3
by: PulkitZery | last post by:
Hi all, I need some help in my project (VB.NET) here is what I need: I need to convert Alphabetic number (a. b. c. d. …..) into the integers (for example a=1, b=2, c=3 and so on). Can anyone...
3
by: superphil56 | last post by:
Hi, I have 3 integers they are the following int startT1H = 05 int startT1M = 00 int startT1S = 00 I realise you cant have the zero before the number 5 in the first integer because it will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.