You are here

function fckeditor_idsearch in FCKeditor - WYSIWYG HTML editor 5.2

Same name and namespace in other branches
  1. 5 fckeditor.module \fckeditor_idsearch()
  2. 6 fckeditor.module \fckeditor_idsearch()

Search the field id for matches in array of matches

@ param $array An $array with strings to match the $search parameter against

Parameters

$search: A string representing a form field id

Return value

TRUE on match, FALSE on no match

1 call to fckeditor_idsearch()
fckeditor_is_enabled in ./fckeditor.module

File

./fckeditor.module, line 2146
FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2007 Frederico Caldeira Knabben

Code

function fckeditor_idsearch($search, $array) {
  foreach ($array as $key => $value) {
    if (!empty($value) && preg_match('/^' . str_replace('*', '.*', addslashes($value)) . '$/i', $search)) {

      // on any first match we know we're done here so return positive
      return TRUE;
    }
  }
  return FALSE;
}