PHP 4 str_split

    Date: 09/09/05 (PHP Community)    Keywords: php

    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;
    }
    

    Source: http://www.livejournal.com/community/php/342557.html

« for chrissakes || Browser.ini »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home