Just want to rearrange the data in array so that similar items are not next to each. The data should not be removed from the array, if it can\'t be rearranged it can be put
Populate your array into a class var, then you can run your custom sort methods on it without changing it. Congratulations, you just created a new nosql database.
What is scaring everyone is losing the original order.
class Dingleberry
{
private $shiz= array();
function __construct(array $a) { $this->shiz = $a; }
##### PUBLIC
public function unmolested() { return $this->shiz; }
/* @see http://www.php.net/manual/en/ref.array.php */
public function sort($type)
{
switch ($type)
{
case 'key_reverse': return krsort($this->shiz); break;
# Check all the php built in array sorting methods to
# make sure there is not already one you want
# then build this out with your own
}
}
}