- var_dump: documentation ( source)
<?php
$original_ids = array(1, 2, 3, 4); //<--- Original values without sorted.
$sorted_ids = array(4, 1, 3); //<--- Fixed values (sort by this)
$result_ids = array(); //<--- The result array after sorted
var_dump($result_ids);