I'm writing an AJAX chat script and I'm integrating a system to parse the time (basically like BBCode). The problem is, when I try casting the time (UNIX timestamp) to an integer for use with date(), it always returns "0". The code I am using to find and replace is below. I've also added a sample of what I'm trying to parse
$out = preg_replace("/\[time\](.*)\[\/time\]/i",date("c",(int)"$1",$out);
Sample:
<b>GtoXic</b>: [time]1342129366[/time]