echo substr('$blogpost', 0, 200); // all the letters between 0 and 200.echo "...";
$input = "Some really long <!--break--> bit of text";$changed = explode("<!--break-->",$input,2);echo $changed[0];echo "...";
function blogBreak($blogpost) { // Set the symbol for the break $break = '<!--break-->'; // Find where the break is in the blog post $position = strpos($blogpost, $break); // Subtract only up to the break $blogshort = substr($blogpost, 0, $position); return $blogshort; }