- substr: documentation ( source)
- var_export: documentation ( source)
<?php
$x = 'yo';
for( $i = 0; $i <= 3; $i++ ) {
echo "substr( '$x', $i ) is: ", var_export(substr( $x, $i ),true), "\n";
}
echo "\n\n";
$x = '';
echo "substr( '$x', 0 ) is: ", var_export(substr( $x, 0 ),true), "\n";
echo "substr( '$x', 1 ) is: ", var_export(substr( $x, 1 ),true), "\n";