function fullparse($string) { //very first, we do the loop_postings, because we need some global data for other functions, aight? $postparsed = parsepostings($string); //now we put the posting-parsing-results into the original string if (isset($postparsed[0]) and $postparsed[0] != false) { foreach ($postparsed as $replace) { $string = str_replace($replace['origin'], $replace['parsed'], $string); } } //then we have to look for other container-tags and parse them. $contparsed = parsecontainer($string); //now we put the container-parsing-results into the original string if (isset($contparsed[0]) and $contparsed[0] != false) { foreach ($contparsed as $replace) { $string = str_replace($replace['origin'], $replace['parsed'], $string); } } //secondly, we have to look for single-tags and parse them, too. $singleparsed = parsesingle($string); //now we put the single-parsing-results into the original template if (isset($singleparsed[0])) { foreach ($singleparsed as $replace) { $string = str_replace($replace['origin'], $replace['parsed'], $string); } } return $string; }
function firstparse($string) { //very first, we do the loop_postings, because we need some global data for other functions, aight? $postparsed = parsepostings($string); //now we put the posting-parsing-results into the original string if (isset($postparsed[0]) and $postparsed[0] != false) { foreach ($postparsed as $replace) { $string = str_replace($replace['origin'], $replace['parsed'], $string); } } return $string; }