I have a php array as follows,
<?php
$arr = array('op'=>'pqr', 'ab'=>'xyz', 'mn'=>'abcd');
?>
How to set xyz value as first element with minimum loop,if the value exist.
Expected Result
<?php
$arr = array('ab'=>'xyz', 'op'=>'pqr','mn'=>'abcd');
?>