From 20a465de812263ab74186f67ab3a3484665430e0 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Fri, 29 Dec 2006 03:47:38 -0500 Subject: [PATCH] format_int() removes leading zeros --- format.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 1.7.10.4