this is my code..
<?php
// first get all the html contents
$page = file_get_contents('http://www.planetled.com.au/blog/what-is-a-led-spotlight/');
//next explode it
$words = explode(" ", $page);
// then display the 21st word or any word you like
echo $words[22]; // 21st word
?>
What I wanted next is to find the 21st human readable word. I'm thinking of using preg_match
to find the word and then use str_replace
but what I'm missing is what patter will I use in preg_match? Thank you.