Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d68e21
)
added format_int_0()
author
Jason Woofenden
<jason183@herkamire.com>
Fri, 29 Jun 2007 04:23:08 +0000
(
00:23
-0400)
committer
Jason Woofenden
<jason183@herkamire.com>
Fri, 29 Jun 2007 04:23:08 +0000
(
00:23
-0400)
format.php
patch
|
blob
|
history
diff --git
a/format.php
b/format.php
index
e158bb3
..
c40f55e
100644
(file)
--- a/
format.php
+++ b/
format.php
@@
-45,6
+45,15
@@
function format_int($str) {
return ereg_replace('^0*([1-9])', '\1', $str);
}
+# return 0 of there's no digits
+function format_int_0($str) {
+ $str = format_int($str);
+ if($str == '') {
+ return '0';
+ }
+ return $str;
+}
+
function format_zip($str) {
return ereg_replace('[^0-9]', '', $str);
}