From: Jason Woofenden Date: Fri, 29 Dec 2006 08:47:38 +0000 (-0500) Subject: format_int() removes leading zeros X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=20a465de812263ab74186f67ab3a3484665430e0 format_int() removes leading zeros --- diff --git a/format.php b/format.php index d5fb32b..fc04b1b 100644 --- a/format.php +++ b/format.php @@ -23,7 +23,8 @@ # This file contains basic encodings function format_int($str) { - return ereg_replace('[^0-9]', '', $str); + $str = ereg_replace('[^0-9]', '', $str); + return ereg_replace('^0*([1-9])', '\1', $str); } function format_oneline($str) {