View Full Version : how to convert hex strings to ascii

11-16-2006, 02:00 AM
I've been searching PHP manuals for a function to convert hex strings to ascii characters and can't find anything that doesn't require a lot of coding.

I have an ascci data file with rows like this:

"Busy doing nothing, %2bnothing%2f much to do, trying not to find lots of things not to do"

is there function to inspect the string and convert the %2b and %2f to their ascii characters?

11-16-2006, 02:22 AM
Take a look at the urldecode(...) function.

11-16-2006, 03:12 AM
I've been looking for that all afternoon.


04-09-2010, 02:12 PM
That is superb....I am sooo glad I found this.

I was struggling with a custom variable sent back by Paypal to a wordpress plugin WPDirectoryPro. It was not recognising the information fed back by the Paypal IPN due to ascii chars being converted, somewhere, into hex!

This is excellent!! Save my life... :)