- substr: documentation ( source)
- abs: documentation ( source)
- str_repeat: documentation ( source)
- error_reporting: documentation ( source)
- strrev: documentation ( source)
<?php
error_reporting(0);
function f($s){for($i=-($l=strlen($s));$i<$l;$I=abs(++$i)){$t=substr($s,$I);echo str_repeat(' ',$I).strrev($t).substr($t,1)."\n";}}
echo "------------\n";
f(" desserts");
echo "------------\n";