(.*?)<\/div>([[:space:]])*<\/div>/s', '', $content);
// allow inside-links
$content = preg_replace('/
', '', $content);
// convert title from h1 to h2
$content = ereg_replace('h1', 'h2', $content);
// the only
with a space after it is under the subtitle, give an extra line
$content = ereg_replace('
[[:space:]]', '
', $content);
if ($withImages) {
$content = handleImages($content, $dateDirectory);
}
if ($content === '') {
echo "\t\tERROR in processing!\n";
}
fwrite($indexFileH, "\n\n");
fwrite($indexFileH, $content);
//add page break to bottom of each article
fwrite($indexFileH, "\n");
}
fwrite($indexFileH, '');
fclose($indexFileH);
}
/**
* Grabs an article's images
*
* @param string $content Article's contents
* @param string $dateDirectory Issue's directory
*
* @return string Content with images
*
*/
function handleImages($content, $dateDirectory)
{
preg_match_all('/
// Illustration by Petra Stefankova
// 