Skip to content

Instantly share code, notes, and snippets.

@d9k
Created May 5, 2014 00:43
Show Gist options
  • Save d9k/76d2b54bd1f9960559e9 to your computer and use it in GitHub Desktop.
Save d9k/76d2b54bd1f9960559e9 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
function mb_str_split($string,$string_length=1,$charset='utf-8') {
if(mb_strlen($string,$charset)>$string_length || !$string_length) {
do {
$c = mb_strlen($string,$charset);
$parts[] = mb_substr($string,0,$string_length,$charset);
$string = mb_substr($string,$string_length,$c-$string_length,$charset);
} while(!empty($string));
} else {
$parts = array($string);
}
return $parts;
}
$alph = mb_str_split('абвгдеёжзийклмнопрстуфхцчшщъыьэюя', 1);
$res = array();
foreach($alph as $a) {
foreach($alph as $b) {
$res[] = $a.$b;
}
}
echo '<pre>';
echo implode ($res, "\n");
echo '</pre>';
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment