I need to sort a multidimensional array by a searched keyword. My array is like below.
<?php
array(
  array(
    'name'    => '11th-Physics',
    'branch'  => 'Plus One',
    'college' => 'Plus One',
  ),
  array(
    'name'    => 'JEE-IIT',
    'branch'  => 'Physics',
    'college' => 'IIT College',
  ),
  array(
    'name'    => 'Physics',
    'branch'  => 'Bsc Physics',
    'college' => 'College of Chemistry',
  ),
  array(
    'name'    => 'Chemical Engineering',
    'branch'  => 'Civil',
    'college' => 'Physics Training Center',
  ),
  array(
    'name'    => 'Physics Education',
    'branch'  => 'Mechanical',
    'college' => 'TBR',
  ),
)
?>
I need to sort this array when search keyword is physics . And after Sorting i need the result like below.
NEEDED RESULT
<?php
array(
  array(
    'name'    => 'Physics',
    'branch'  => 'Bsc Physics',
    'college' => 'College of Chemistry',
  ),
  array(
    'name'    => 'Physics Education',
    'branch'  => 'Mechanical',
    'college' => 'TBR',
  ),
  array(
    'name'    => '11th-Physics',
    'branch'  => 'Plus One',
    'college' => 'Plus One',
  ),
  array(
    'name'    => 'JEE-IIT',
    'branch'  => 'Physics',
    'college' => 'IIT College',
  ),
  array(
    'name'    => 'Chemical Engineering',
    'branch'  => 'Civil',
    'college' => 'Physics Training Center',
  ),
)
?>
That is I need to sort the array first by the name which is exactly like  the searched keyword. Then wildcard search in name. Then to the next key branch and same as above. Is there any php function to sort this array like my requirement. I have already checked asort, usort. But I didn't  get result properly.
 
     
    