function PARSEENTRIES::explodeString in Bibliography Module 6.2
Same name and namespace in other branches
- 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::explodeString()
- 6 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::explodeString()
- 7.3 plugins/biblio_style/bibtex/PARSEENTRIES.php \PARSEENTRIES::explodeString()
- 7 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::explodeString()
- 7.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::explodeString()
1 call to PARSEENTRIES::explodeString()
- PARSEENTRIES::removeDelimitersAndExpand in modules/
bibtexParse/ PARSEENTRIES.php
File
- modules/
bibtexParse/ PARSEENTRIES.php, line 366
Class
Code
function explodeString($val) {
$openquote = $bracelevel = $i = $j = 0;
while ($i < strlen($val)) {
if ($val[$i] == '"') {
$openquote = !$openquote;
}
elseif ($val[$i] == '{') {
$bracelevel++;
}
elseif ($val[$i] == '}') {
$bracelevel--;
}
elseif ($val[$i] == '#' && !$openquote && !$bracelevel) {
$strings[] = substr($val, $j, $i - $j);
$j = $i + 1;
}
$i++;
}
$strings[] = substr($val, $j);
return $strings;
}