original_string: public static function sortArrayByArray(array $array, array $orderArray)
      {
          $ordered = array();
          foreach ($orderArray as $key) {
              if (array_key_exists($key, $array)) {
                  $ordered[$key] = $array[$key];
                  unset($array[$key]);
              }
          }
          return $ordered + $array;
      }
code: public static function sortArrayByArray(array $array, array $orderArray)
      {
          $ordered = array();
          foreach ($orderArray as $key) {
              if (array_key_exists($key, $array)) {
                  $ordered[$key] = $array[$key];
                  unset($array[$key]);
              }
          }
          return $ordered + $array;
      }
code_tokens: public static function sortArrayByArray ( array $ array , array $ orderArray ) { $ ordered = array ( ) ; foreach ( $ orderArray as $ key ) { if ( array_key_exists ( $ key , $ array ) ) { $ ordered [ $ key ] = $ array [ $ key ] ; unset ( $ array [ $ key ] ) ; } } return $ ordered + $ array ; }
docstring: Sort a multidimensional array  by another array of ordered keys
  
  @param array $array
  @param array $orderArray
  @return array
docstring_tokens: Sort a multidimensional array by another array of ordered keys