I am trying to compute the difference between all values in an array and store them (the differences) in a single array.
An ideal example would be something like this:
<?php
$data = array('1', '5', '12');
// Compute the difference between each value with another value.
?>
And then I like to have the following results in an array:
4, 11, 7
How can I achieve it?