I want to change the way the number is produced, based on what the number value is. The default values are in unix epoch, I convert them to hours in echo.
$clock = time();
$sql = "SELECT unix FROM things";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo round(($row["unix"] - $clock)/3600) .' hours from now.;
Right now it works, and it shows hours correctly, BUT i want to change it based on what unix timestamp shows, this is where it gets tricky. I want that The "hours" would be changed to minutes if the unix seconds are less than 3600, to seconds if it is less than 60, to days if it is more than 86400. How the hell do I do that?