Skip to content

Instantly share code, notes, and snippets.

@girvan
Created March 22, 2012 03:28
Show Gist options
  • Save girvan/2155412 to your computer and use it in GitHub Desktop.
Save girvan/2155412 to your computer and use it in GitHub Desktop.
<?php
function mb_str_split($string,$string_length=1) {
if(mb_strlen($string)&gt;$string_length || !$string_length) {
do {
$c = mb_strlen($string);
$parts[] = mb_substr($string,0,$string_length);
$string = mb_substr($string,$string_length);
}while(!empty($string));
} else {
$parts = array($string);
}
return $parts;
}
@ngothoai
Copy link

ngothoai commented Jun 1, 2016

But not number 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment