Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use preg instead of ereg
[wfpl.git]
/
time.php
diff --git
a/time.php
b/time.php
index
3c42f79
..
f71d22a
100644
(file)
--- a/
time.php
+++ b/
time.php
@@
-76,8
+76,8
@@
function clean_ymd($year, $month, $day) {
# pass date like 3/21/99
# returns array(year, month, day)
function mdy_clean($date) {
# pass date like 3/21/99
# returns array(year, month, day)
function mdy_clean($date) {
- $date = ereg_replace('[^0-9/-]', '', $date);
- $date = ereg_replace('-', '/', $date);
+ $date = preg_replace('|[^0-9/-]|', '', $date);
+ $date = preg_replace('|-|', '/', $date);
$parts = explode('/', $date);
switch(count($parts)) {
case 1:
$parts = explode('/', $date);
switch(count($parts)) {
case 1:
@@
-108,8
+108,8
@@
function mdy_to_ymd($date) {
# pass date like 2008-11-21
# returns array(year, month, day)
function ymd_clean($date) {
# pass date like 2008-11-21
# returns array(year, month, day)
function ymd_clean($date) {
- $date = ereg_replace('[^0-9/-]', '', $date);
- $date = ereg_replace('/', '-', $date);
+ $date = preg_replace('|[^0-9/-]|', '', $date);
+ $date = preg_replace('|/|', '-', $date);
$parts = explode('-', $date);
switch(count($parts)) {
case 1:
$parts = explode('-', $date);
switch(count($parts)) {
case 1: