Return to Snippet

Revision: 22518
at January 14, 2010 04:43 by Helbom


Initial Code
function scramble($text)
{
	$length = strlen($text);
	$output = '';
	
	for ($i = 0; $i < $length; $i++)
	{
		$output .= "&#" . ord(substr($text,$i,1)) . ";";
	}
	return $output;
}

Initial URL


Initial Description
This function does not scramble the output text. But it obfuscates the text in the source code. A very useful function to "hide" emails and other things that you dont want robots to find..

Usage:
echo scramble("scramble me");

Result:
- Front: scramble me
- Source: &#115;&#99;&#114;&#97;&#109;&#98;&#108;&#101;&#32;&#109;&#101;

Initial Title
Obfuscate text source

Initial Tags


Initial Language
PHP