Andrew R Posted May 26, 2011 Share Posted May 26, 2011 Hi there. I was wondering if it were possible to convert text to numbers or some sort of URL friendly link. For example, "Hello there" would be converted to '435342553' or whatever. I want to do this because for example when someone goes to this URL, example.com/435343434, the number/uri string would be decoded and whatever the text was it would be displayed on the site. I can write all this code no bother I just need some advice/ideas on the the encoding/decoding of the text. I was looking at some options for doing this..... hexdec - removes spaces md5 - cannot be decoded? None of them seem to be working, the problem is decoding them. md5 creates a perfect uri string but as I said it cannot be decoded. I would appreciate any ideas of suggestions. Thanks a million. Quote Link to comment https://forums.phpfreaks.com/topic/237515-encodeconvert-text-to-numbersbinary/ Share on other sites More sharing options...
Fadion Posted May 26, 2011 Share Posted May 26, 2011 You could use ord and chr to convert a string into it's ascii value. It still makes no sense to me why you want to use numbers instead of humanly-readable text in URLs anyway. Quote Link to comment https://forums.phpfreaks.com/topic/237515-encodeconvert-text-to-numbersbinary/#findComment-1220523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.