search_query_extract

Definition

search_query_extract($keys, $option)
modules/search/search.module, line 667

Description

Extract a module-specific search option from a search query. e.g. 'type:book'

Code

<?php
function search_query_extract($keys, $option) {
  if (preg_match('/(^| )'. $option .':([^ ]*)( |$)/i', $keys, $matches)) {
    return $matches[2];
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.