submitted by: Snippissimo

PHP: Strip leading comma from a string

This snippet removes the leading comma (if there is one)from a string using the ltrim command.


code snippet:
<?php
 $oldstring 
",there should be no leading comma";
 
$string ltrim($oldstring",");
 echo 
$string;
?>

sample output:
there should be no leading comma