AV1611 Posted September 23, 2007 Share Posted September 23, 2007 I have been trying to figure out how to do this, but can't seem to get the right functions from the manual: I want to convert the follow string to hex and back $string="mary had a little lamb"; $string2=somefunction($string); //now it's in HEX $string3=someotherfunction($string2); // now it's back to normal echo $string3; //produces mary had a little lamb Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/70357-solved-silly-hex-thingy/ Share on other sites More sharing options...
kathas Posted September 23, 2007 Share Posted September 23, 2007 you should check the ord() function and the dechex() check them in the manual... Quote Link to comment https://forums.phpfreaks.com/topic/70357-solved-silly-hex-thingy/#findComment-353424 Share on other sites More sharing options...
leonglass Posted September 23, 2007 Share Posted September 23, 2007 What do you want to convert - is it the numbers used to represent the characters? If so try looking at this function Quote Link to comment https://forums.phpfreaks.com/topic/70357-solved-silly-hex-thingy/#findComment-353426 Share on other sites More sharing options...
Guardian-Mage Posted September 23, 2007 Share Posted September 23, 2007 $string="mary had a little lamb"; $string2= bin2hex($string); //now it's in HEX $string3= pack('H*', $string2); // now it's back to normal echo $string3; //produces Result" mary had a little lamb Quote Link to comment https://forums.phpfreaks.com/topic/70357-solved-silly-hex-thingy/#findComment-353428 Share on other sites More sharing options...
AV1611 Posted September 23, 2007 Author Share Posted September 23, 2007 Thank you all for the help. I haven't figure out what to do with this, but I'm trying to come up with a "email-havester" proof way of using email addresses on a website, etc. Maybe this is dead end, but I've never seen this approach before. The idea is to do this instead of posting an email addy: <a href="whatever.php?data=6f7370726579407472757468736f6c64696572732e636f6d" target="_blank">[click to see my email addy]</a> You could actually display addy and an <img> as part of the href... you get the idea... Maybe make a function for a CMS? it's still just an idea... At least the actual email addy is nowhere on the website, so can't be havested... I haven't worked it all out yet and it may just be a silly dead end, but hey, it's the weekend Quote Link to comment https://forums.phpfreaks.com/topic/70357-solved-silly-hex-thingy/#findComment-353440 Share on other sites More sharing options...
leonglass Posted September 23, 2007 Share Posted September 23, 2007 Use a contact form and php so that the e-mail address is never seen on the page. Quote Link to comment https://forums.phpfreaks.com/topic/70357-solved-silly-hex-thingy/#findComment-353444 Share on other sites More sharing options...
AV1611 Posted September 27, 2007 Author Share Posted September 27, 2007 That's what I do now, I had posting on a forum / cms/ blog in mind. The idea *might* be to create a PNG with the posters email addy, and use that in the href somehow. It's just an idea. That's all. Quote Link to comment https://forums.phpfreaks.com/topic/70357-solved-silly-hex-thingy/#findComment-356458 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.