so I have a table which lists chat messages in my game server (chat messages are stored in a database) and I have a UNIX timestap like this (for example) 1455749769
Does anyone know how I can use php to convert the timestamp so it echos how long ago the chat message was for example: "5 Seconds Ago"
Here is my table
$name=$row['client_name'];
$time=$row['msg_time'];
$name=htmlentities($name);
echo "<tr>";
echo "<td> $time </td>";
echo "<td><a href='http://144.76.158.173/ech/user.php?id=".$row["client_id"]."' > $name </a></td>";
echo "<td> $msg </td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "0 results";
echo "</div>";
}
$conn->close();
?>
Any help greatly appreciated :)