Return to Snippet

Revision: 22429
at January 12, 2010 12:19 by cessnajumpin


Initial Code
public function makeNewsExcerpt($content)
    {
	$content = preg_replace("(\<(/?[^\>]+)\>)", "", $content);
	$content = substr($content, 0, 160);
	$content .= "...";
	return $content;

    }

Initial URL

                                

Initial Description
Create an excerpt from the main copy, removing any image or other HTML tag markup so it will be clean. In this case the length is 160 characters, change that number to change the length of the excerpt

Initial Title
Excerpt with Tag Stripping

Initial Tags
php

Initial Language
PHP