'; $start_ellipsis = $end_ellipsis = true; foreach (array( 'start' => -1, 'end' => 1 ) as $variable => $direction) { ${$variable} = $pos + ($options['excerpt_distance'] * $direction); if ($variable == "end") { ${$variable} += strlen($search_string); } if (${$variable} < 0) { ${$variable} = 0; $start_ellipsis = false; } if (${$variable} > $l) { ${$variable} = $l; $end_ellipsis = false; } } $output = ""; if ($start_ellipsis) { $output .= "..."; } $output .= str_replace($search_string, "" . $search_string . "", trim(substr($transcript['transcript'], $start, $end - $start))); if ($end_ellipsis) { $output .= "..."; } echo $output; echo '
'; echo '