I have a function that formats datetime.
<?
// functions.php - useful global functions
// format MySQL DATETIME value into a more readable string
function formatDate($val)
{
$arr = explode("-", $val);
return date("d M Y", mktime(0,0,0, $arr[1], $arr[2], $arr[0]));
}
?>
This function is included in a file using:
// includes
include("../includes/config.php");
include("../includes/functions.php");
I have the function in the following code:
echo "
<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
<tr>
<td align=\"left\"> <font size=\"-1\"><b>$row->PressReleaseHeadline </b>
[formatDate($row->PressReleaseDate)]</font> <br> <font size=\"-2\"><a href=\"edit.php?id=$row->PressReleaseID\">edit</a>
| <a href=\"delete.php?id=$row->PressReleaseID \">delete</a></font>
<p></td>
</tr>
";
The problem is that this function is simply echoing
[formatDate($row->PressReleaseDate)]
How do I correct this?