/** rotate a string, use for simple encoding */ function rotateString($pInput,$pRotateNum=0) { $vOutput = ”; $vStr = ‘abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890|’; $vLen = strlen($vStr); for ($i=0;$i $vIndex = strpos($vStr,$pInput{$i}); if ($vIndex===FALSE) { // non-encode chars, leave these alone $vOutput .= $pInput{$i}; } else { $vIndex = $vIndex+$pRotateNum; $vIndex = $vIndex>0?$vIndex%$vLen:($vLen+$vIndex)%$vLen; $vOutput .= $vStr{$vIndex}; } // fi } // rof //var_dump($vOutput); return $vOutput; }
$a = rotateString($b,19); // encode $b = rotateString($a,-19); // decode
Name(required)
Mail (will not be published)(required)
Website
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>