How can PHP beginners efficiently remove leading zeros from numbers?

When dealing with numbers in PHP, beginners may encounter the need to remove leading zeros from numeric values. One efficient way to achieve this is by typecasting the number to an integer, which automatically removes any leading zeros. This can be done using the intval() function in PHP.

$number = "00123";
$numberWithoutZeros = intval($number);
echo $numberWithoutZeros; // Output: 123