Q:

Write a PHP script to remove all leading zeroes from a string

0

Write a PHP script to remove all leading zeroes from a string.

Original String : '000547023.24'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$x = '000547023.24';
$str1 = ltrim($x, '0');
echo $str1."\n";
?>

Sample Output:

547023.24

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now