Author Topic: Is there a dec to char function prebuilt in php?  (Read 441 times)

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Is there a dec to char function prebuilt in php?
« on: November 19, 2009, 03:52:26 AM »
I'm trying to make a quick converter for one of the missions on hts. And i need to know if there's a built in Dec to the char equivalent. If there is not then i can just code one, or atleast believe i shoudl be able to.

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Is there a dec to char function prebuilt in php?
« Reply #1 on: November 19, 2009, 04:27:05 AM »
http://php.net/manual/en/function.chr.php
Even the most simplified C64 Basic had this one :)

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Is there a dec to char function prebuilt in php?
« Reply #2 on: November 19, 2009, 04:43:31 AM »
now i saw this in there. But for some reason, i didn't know how well it'd work. :P since they were confusing it by me. Now to sit down and start working with it. Thanks for clarifying that it's truly what i thought it was.

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Is there a dec to char function prebuilt in php?
« Reply #3 on: November 19, 2009, 08:36:36 AM »
Be aware this is only for ASCII characters. You cannot, for instance, retrieve a UTF-8 character with this function.

PHP is still trying to become truly multi-byte character compliant. In fact, PHP 6 is supposed to ship with the default encoding set to UTF-8 (at least, to the last of my knowledge).
Idiocy - Never underestimate the power of stupid people in large groups.


 


SimplePortal 2.3.3 © 2008-2010, SimplePortal