You are here

function PARSEENTRIES::searchReplaceText in Bibliography Module 7.3

Same name and namespace in other branches
  1. 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::searchReplaceText()
  2. 6.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::searchReplaceText()
  3. 6 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::searchReplaceText()
  4. 7 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::searchReplaceText()
  5. 7.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::searchReplaceText()
1 call to PARSEENTRIES::searchReplaceText()
PARSEENTRIES::parseEntry in plugins/biblio_style/bibtex/PARSEENTRIES.php

File

plugins/biblio_style/bibtex/PARSEENTRIES.php, line 174

Class

PARSEENTRIES

Code

function searchReplaceText($searchReplaceActionsArray, $sourceString, $includesSearchPatternDelimiters = FALSE) {
  $searchStrings = array_keys($searchReplaceActionsArray);
  if (!$includesSearchPatternDelimiters) {
    foreach ($searchStrings as $key => $value) {
      $searchStrings[$key] = "/" . $value . "/";

      // add search pattern delimiters
    }
  }
  $replaceStrings = array_values($searchReplaceActionsArray);

  // apply the search & replace actions defined in '$searchReplaceActionsArray' to the text passed in '$sourceString':
  return preg_replace($searchStrings, $replaceStrings, $sourceString);
}