I got an array that outputs data into an xml. It looks like this:
$data = array(
'trip_id' => $this->trip_id,
'from' => $this->from,
'from_lat' => $this->from_lat,
'from_lon' => $this->from_lon,
'to' => $this->to,
'to_lat' => $this->to_lat,
'to_lon' => $this->to_lon,
'when' => $this->when,
'when_iso' => date('Y-m-d H:i', $this->when),
'details' => $this->details,
'got_car' => $this->got_car,
'inserted' => $this->inserted,
'name' => $this->name,
'email' => $this->email,
'phone' => $this->phone,
);
$this_when contains a unix timestamp and I would like to add a new type of time wich is when_rel, it should contain the number of days from today that the unix timestamp refers to. (1, 2 etc.)
I would like t know how to apply math to a value fetched from an array. I tried this but it just puts out an error:
'when_rel' => ($this->when/60);
Have you tried
'when_rel' => ($this->when/60)?