/** * @param string $addpunctuation */ function mlabooktitleformat($booktitleinput, $addpunctuation) { //Uppercase the words in book title $html = uppercasewords($booktitleinput); //Lowercase all articles, prepositions, & conjunctions $html = forcearticlelower($html); //If the article title contains a subtitle, capitalize the first word after the colon if (preg_match('/:[ ]+[a-z]/', $html, $regs)) { $html = subtitleucfirst($html, $regs); } if ($addpunctuation == "yes") { //Punctuate after the book title, if necessary $html = articleperiod($html); } $html = '<i>' . $html . '</i>'; return $html; }
function booktitleapaformat($booktitleinput, $addpunctuation) { //Uppercase the first word in article title $html = uppercasefirstword($booktitleinput); //If the article title contains a subtitle, capitalize the first word after the colon if (preg_match('/:[ ]+[a-z]/', $html, $regs)) { $html = subtitleucfirst($html, $regs); } if ($addpunctuation == "yes") { //Punctuate after the book title, if necessary $html = articleperiod($html); } $html = '<i>' . $html . '</i>'; return $html; }