Jump to content

Code conversion in PHP


Tazz

Recommended Posts

I don't really know how to explain this, I saw once on some forum members signature, something like this :

G = "\ x50 \ x72 \ 157 \ 144 \ x75 \ x63 \ 164 \ x20 \ x6c \ x69 \ 143 \ 145 \ 156 \ x73 \ 145 \ 040 \ x68 \ 141 \ x73 \ 040 \ x65 \ x78 \ 160 \. 151 \ 162 \ x65 \ 144 \ x2e \ x20 "+ E.

 

That somehow translates into words, I know there is a PHP function to convert that, what is that code called and what is the PHP function?

Link to comment
https://forums.phpfreaks.com/topic/217634-code-conversion-in-php/
Share on other sites

i found this by googling... not sure if this helps...

For primitives just use (string)$var or print this variable straight away. PHP is dynamically typed language and variable will be casted to string on the fly.

If you want to convert objects to strings you will need to define __toString() method that returns string. This method is forbidden to throw exceptions.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.