Skip to content

Instantly share code, notes, and snippets.

View myxzlpltk's full-sized avatar
🤔
thinking

Saddam Azy myxzlpltk

🤔
thinking
View GitHub Profile
@wpscholar
wpscholar / excerpt.php
Created January 10, 2014 21:31
Generate an excerpt from provided content. Strips HTML, removes trailing punctuation and adds a 'more' string when text has been removed.
<?php
/**
* Get an excerpt
*
* @param string $content The content to be transformed
* @param int $length The number of words
* @param string $more The text to be displayed at the end, if shortened
* @return string
*/