str_split in PHP4

/ Published in: PHP
Save to your folder(s)

Taken from Doug Sparling's Blog

Copy this code and paste it in your HTML
  1. function str_split($str) {
  2. $str_array=array();
  3. $len=strlen($str);
  4. for($i=0; $i<$len; $i++) {
  5. $str_array[]=$str{$i};
  6. }
  7. return $str_array;
  8. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.