X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=format.php;h=fc04b1be56129e61d66d942d35dfff6f66c6aac6;hb=e3c093250e28f834151eb6ddba5ad965a8e6651b;hp=60d0bf08a531f279862d0700726a3ff6cc70b3dd;hpb=fe7ab127fc133be74b2601cbaa3ae789d7e2a2d7;p=wfpl.git diff --git a/format.php b/format.php index 60d0bf0..fc04b1b 100644 --- a/format.php +++ b/format.php @@ -22,6 +22,11 @@ # This file contains basic encodings +function format_int($str) { + $str = ereg_replace('[^0-9]', '', $str); + return ereg_replace('^0*([1-9])', '\1', $str); +} + function format_oneline($str) { $str = str_replace("\r", '', $str); return str_replace("\n", '', $str);