PHP/String/ltrim
Версия от 10:37, 26 мая 2010; (обсуждение)
Left padding using the default of spaces
<?php
printf("<pre>Space padding can be tricky in HTML %5d.
</pre>", 42);
?>
ltrim() function removes the whitespace and special characters from the left side of string
Its syntax follows: string ltrim (string str)
<?
print ">".ltrim(" asdf ")."<";
?>
ltrim() function to strip white space only from the beginning of a string.
<?php
$text = "\t\t\tlots of room ";
$text = ltrim( $text );
print "<pre>$text</pre>";
?>