function blurbify($blurb)
{
$blurb = ucfirst(trim($blurb));
if (strpos($blurb, '.', strlen($blurb) - 2) == False)
$blurb .= '.';
$interviewer = (strpos($blurb, 'John Geddes:')) ? 'John Geddes:' : 'John:';
$exploded_blurb = explode($interviewer, $blurb);
$blurb = $exploded_blurb[0];
if (count($exploded_blurb) > 1)
{
foreach (array_slice($exploded_blurb, 1) as $b)
{
$end_idx = max(strrpos(substr($b, 0, strpos($b, ':')), "\n"), strrpos(substr($b, 0, strpos($b, ':')), ' '));
$john = '
'.$interviewer.substr($b, 0, $end_idx).'
';
$interviewee = substr($b, $end_idx);
$blurb .= $john.$interviewee;
}
}
return $blurb;
}
?>
Search
Close filter options
Filter options