- var_dump: documentation ( source)
- array_merge: documentation ( source)
<?php
$sortBy = array(
'foo' => 'some',
'bar' => 'not',
'wat' => 'important',
'baz' => 'stuff',
);
$dataToSort = array(
'baz' => 'Baz stuff',
'bar' => 'Bar things',
'wat' => 'Simply wat',
'foo' => 'Foo yourself',
);
var_dump(array_merge($sortBy, $dataToSort));