如何删除字符串中的所有前导零

问题描述:

如果我有一个字符串

00020300504
00000234892839
000239074

我如何摆脱前导零,这样我就只能拥有这个了

how can I get rid of the leading zeroes so that I will only have this

20300504
234892839
239074

请注意,上面的数字是随机生成的.

note that the number above was generated randomly.

:

$str = ltrim($str, '0');