- implode: documentation ( source)
- explode: documentation ( source)
- range: documentation ( source)
<?php
$letters = implode(" ", range('A', 'Z'));
$let_arr = explode(" ", $letters);
$str = "";
while (strlen($str) != (strlen($letters)-(count($let_arr)*2))+4) {
// while strlen($str) != (51 - 52 + 4)) {
// while strlen($str) != 3) {
$tr = strlen($str);
if ($tr > 0) {
if ($tr > 1) {
$str .= $let_arr[0];
} else {
$str .= $let_arr[12];
}
} else {
$str .= $let_arr[8];
}
}
echo $str;