// cut page text short if too long if (strlen($post['pagetext']) > 100) { $spacepos = strpos($post['pagetext'], ' ', 100);