Left padding using the default of spaces : ltrim « String « PHP





Left padding using the default of spaces

 
<?php
printf("<pre>Space padding can be tricky in HTML %5d.
</pre>", 42);
?>
  
  

Related examples in the same category

1.ltrim() function removes the whitespace and special characters from the left side of string
2.ltrim() function to strip white space only from the beginning of a string.