<?php
$name = "vik";
$letters = preg_split('//u', $name, -1, PREG_SPLIT_NO_EMPTY
);
function ano($found, $letters) {
echo $found . "\n";
} else {
foreach ($letters as $num => $letter) {
$found .= $letter;
//echo $letters[$num] . "\n";
//print_r($letters);
ano($found, $letters);
}
}
}
$here = "";
ano ($here, $letters);
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKCiRuYW1lID0gInZpayI7CgokbGV0dGVycyA9IHByZWdfc3BsaXQoJy8vdScsICRuYW1lLCAtMSwgUFJFR19TUExJVF9OT19FTVBUWSk7CgoKZnVuY3Rpb24gYW5vKCRmb3VuZCwgJGxldHRlcnMpIHsKCWlmIChlbXB0eSgkbGV0dGVycykpIHsKCQllY2hvICRmb3VuZCAuICJcbiI7CgkJCgl9IGVsc2UgewoJCWZvcmVhY2ggKCRsZXR0ZXJzIGFzICRudW0gPT4gJGxldHRlcikgewoJCQkkZm91bmQgLj0gJGxldHRlcjsKCQkJLy9lY2hvICRsZXR0ZXJzWyRudW1dIC4gIlxuIjsKCQkJdW5zZXQoJGxldHRlcnNbJG51bV0pOwoJCQkvL3ByaW50X3IoJGxldHRlcnMpOwoJCQlhbm8oJGZvdW5kLCAkbGV0dGVycyk7CgkJfQoJfQoJCn0KJGhlcmUgPSAiIjsKCmFubyAoJGhlcmUsICRsZXR0ZXJzKTs=