phpbuilt
Account compromised December 2025
- May 16, 2011
- 1,865
- 5,369
PHP:
function spin($pass){
$mytext = $pass;
while(inStr("}",$mytext)){
$rbracket = strpos($mytext,"}",0);
$tString = substr($mytext,0,$rbracket);
$tStringToken = explode("{",$tString);
$tStringCount = count($tStringToken) - 1;
$tString = $tStringToken[$tStringCount];
$tStringToken = explode("|",$tString);
$tStringCount = count($tStringToken) - 1;
$i = rand(0,$tStringCount);
$replace = $tStringToken[$i];
$tString = "{".$tString."}";
$mytext = str_replaceFirst($tString,$replace,$mytext);
}
return $mytext;
}
function str_replaceFirst($s,$r,$str){
$l = strlen($str);
$a = strpos($str,$s);
$b = $a + strlen($s);
$temp = substr($str,0,$a) . $r . substr($str,$b,($l-$b));
return $temp;
}
function inStr($needle, $haystack){
return @strpos($haystack, $needle) !== false;
}
Supports nested spinning to infinite levels.
If you're sending articleranks.com spins to it, just convert "[" and "]" to "{" "}" ... and "~" to "|".
BTW I wrote this myself. Use it however you want. Let me know if you have any questions.
Enjoy!
Last edited: