[PHP] Stumped on a function

2002-06-21 Thread Jason Soza
I've been using the following function successfully for months, tonight I literally copied/pasted it to another page I was creating, called it exactly the same using the same data type, and I'm getting an incorrect result. The function is supposed to take a standard MySQL CCYY-MM-DD date format

RE: [PHP] Stumped on a function

2002-06-21 Thread David Freeman
function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } I suspect that you actually need something like this: function cleandate($indate) { $indate = str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); }

RE: [PHP] Stumped on a function

2002-06-21 Thread John Holmes
Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all?? ---John Holmes... -Original Message- From: Jason Soza [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 3:50 AM To: PHP-General Mailing List Subject: [PHP] Stumped

Re: [PHP] Stumped on a function

2002-06-21 Thread Jesper Brunholm
John Holmes wrote: Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all?? you might want a link to that: http://www.mysql.com/doc/D/a/Date_and_time_functions.html - look somewhat below the middle of the page function cleandate($indate) {

Re: [PHP] Stumped on a function

2002-06-21 Thread Jason Soza
- From: Jesper Brunholm [EMAIL PROTECTED] Date: Friday, June 21, 2002 2:02 am Subject: Re: [PHP] Stumped on a function John Holmes wrote: Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all?? you might want a link to that: target=lhttp