Jump to content


Photo

converting into 7 Bit ASCII format in PHP, Is this possible??


  • Please log in to reply
4 replies to this topic

#1 codeexploiter

codeexploiter
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 10 October 2006 - 06:52 AM

Hi all,

I am looking for any method/function using which i can convert a character into its corresponding 7 Bit ASCII value using PHP.

For example ! (exclamation mark) has a 7 Bit ASCII value of !

Is there any function or way that returns the 7 bit ASCII value of a character? Any help would be appreciated greatly

Regards

Code Exploiter

#2 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 10 October 2006 - 07:59 AM

Are you looking for the ord() function?

#3 codeexploiter

codeexploiter
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 10 October 2006 - 10:04 AM

hmmm yes it returns 33 which is the ASCII value of ! but in 7-bit ASCII format its value is &33;. I wonder whether there is any other method that returns the exact 7 bit ASCII value rather than 33.

Thanks for the help you provided.

I hope to hear from u more about this in the future

#4 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 10 October 2006 - 10:11 AM

Try htmlentities()

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#5 codeexploiter

codeexploiter
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 10 October 2006 - 10:32 AM

Not working it returns ! itself. I am unable to get the HTML equivalent of ! which is &33;

Regards

code




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users