X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=format.php;h=a658dbba05f02dea7069388dcfb49711dde75db2;hb=21c47e88810e97fe5b727c9c2689f64533bf6452;hp=a0e2f85f02d3a8438c5b66eb8d5fa4542454deee;hpb=1f787c4ef79ce26a5385bd325586e7796fadf8b4;p=wfpl.git diff --git a/format.php b/format.php index a0e2f85..a658dbb 100644 --- a/format.php +++ b/format.php @@ -26,6 +26,10 @@ function format_int($str) { return ereg_replace('^0*([1-9])', '\1', $str); } +function format_zip($str) { + return ereg_replace('[^0-9]', '', $str); +} + function format_filename($str) { $str = strtolower($str); $str = ereg_replace('[^a-z0-9_.-]', '_', $str); @@ -48,10 +52,10 @@ function format_unix($str) { } function format_yesno($str) { - if($str) { - return "Yes"; + if($str && $str != 'No') { + return 'Yes'; } else { - return "No"; + return 'No'; } }