- substr: documentation ( source)
- preg_replace: documentation ( source)
<?php
$str = <<<STR
THEDLSDARNVNS
CCVBXXMTGFRWS
CVIYTVBVSDOPTR
VBNMAITYSURFD
MOTYYERSAWERTY
MOITRUHDYRTBDI
VNOWUNMBORN
STR;
$str = preg_replace("/\s|\n/", "", $str);
$fib = [1, 2, 3, 5, 8, 13];
foreach ($fib as $pos) {
echo substr($str, $pos, 1);
}