PHP String Exercises : Remove all leading zeroes from a string
PHP String: Exercise-19 with Solution
Write a PHP script to remove all leading zeroes from a string.
Original String : '000547023.24'
<?php $x = '000547023.24'; $str1 = ltrim($x, '0'); echo $str1."\n"; ?>
PHP Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?