- substr: documentation ( source)
- array_slice: documentation ( source)
- explode: documentation ( source)
<?php
$str = "AULIA";
$word ="";
Foreach(array_slice(explode(" ", $str),0,3) as $c) $word .= $c[0];
If(strlen($word) < 3) $word .= Substr($c,1,3-strlen($word));
Echo $word;