$pos && $npos < $len ) { $pos = $npos; } } if ( !$pos ) { // substr $len-3, because the ellipsis adds 3 chars return substr($str, 0, $len-3) . '...'; } else { // $pos+1 to grab punctuation mark return substr($str, 0, $pos+1); } } $mystring = <<

Three monsters decided to fly off into the sky, today.

three_red_monsters.jpg
EOD; echo ''; ?>
How are the monsters made? How are the monsters made? Today's Insta-Monster! Today's Insta-Monster! Give a monster his pants. Give a monster his pants. New personal monster page! New personal monster page! More Monster Clubhouse More Monster Clubhouse Fillipe eats cake! Fillipe eats cake! Meet Margaret McSluggerton Meet Margaret McSluggerton Angry Monster and bedtime Angry Monster and bedtime Angry Monster and the economy Angry Monster and the economy Monster Clubhouse overhaul! Monster Clubhouse overhaul!

Kristen's monsters are here to tell you about .

Three monsters decided to fly off into the sky, today.

three_red_monsters.jpg

Three red monsters

Sunday, January 25, 2009

Three monsters decided to fly off into the sky, today.

three_red_monsters.jpg

Three red monsters

Three monsters decided to fly off into the sky, today.

three_red_monsters.jpg