Skip to content

Instantly share code, notes, and snippets.

View AndyChoo's full-sized avatar
💭
Doing cowork

Andy Choo AndyChoo

💭
Doing cowork
  • Rubysoft Solution
  • Petaling Jaya, Selangor
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
*/