sourpatchkid wrote in php

PHP 4 str_split

Is there a version of, or something like str_split in PHP4? My code works on localhost because I'm running PHP5 but my server (non-upgradable) is PHP 4.X.

function random($str){
	$count = strlen($str);
	$arr0 = str_split($str);
	$arr1 = array();
	for($i = 0; $i < $count; $i++){
		$rand = rand(0, ($count) - 1); 
		$arr1[$i] = $arr0[$rand];
	}
	
	$screenName = implode($arr1);
	
	return $screenName;
}