Publisher review:Pull first x words from a string - Grabs the first x words from a string. Pull first x words from a string - Grabs the first x words from a string.
Source Code
function firstwords($str,$wordcount) { # Gareth (omnipotent.net) 0wnz m3. # Someday, I will be able to do this sort of thing when I grow up. $words=preg_split(''/([Warning: Unexpected character in input: '' (ASCII=92) state=1 in /home/sfy/public_html/snippets/view.php on line 32s.,;] )/'',$str,$wordcount 1,PREG_SPLIT_DELIM_CAPTURE); array_pop($words); return(implode('''',$words)); }
Pull first x words from a string is a PHP script for Snippets scripts design by ScriptsForYou.
It runs on following operating system: Windows / Linux / BSD.
Operating system:Windows / Linux / BSD