Aug 15

PHP Version:

function toascii($s){
	$tmp = "";
	for($i=0;$i<strlen($s);$i++){
		$tmp .= "&#" .hexdec(bin2hex($s[$i])) . ";";
	}
	return htmlentities($tmp);
}

Python Version:

import urllib
def encodeDork(s):
	tmp = ""
	for i in xrange(0,len(s)): tmp += "&#" + str(int(binascii.b2a_hex(s[i]), 16)) + ";"
	return urllib.quote(tmp)

Something quick I did.. Very useful for blocked Google queries ;)

  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.