Page 1 of 1

need suggestion; for searching a word inside an html page

Posted: Fri Feb 28, 2014 5:34 am
by gghhh456
Hello every1,

I have a small project to do and I dont know whether PHP is the right language for this. But I am open to any other languages based on C/C++. I have knowledge in HTML, PHP and Java, but i am no expert, just an intermediate.

okay, Regarding my project:

I have a dynamic web page written in PHP, all I have to do search for certain words and count how many times these word has appeared. Table them with rows and columns.

My question is;

1. Is it possible to do using PHP or should I look for another programming language?

2. If its possible could you point me to right direction like where I should I look for.


Cheers

Gg.

Re: need suggestion; for searching a word inside an html pag

Posted: Fri Feb 28, 2014 5:45 am
by Celauran
You could read the page in with file_get_contents or cURL and then find your words with preg_match_all or by iterating over it and using stripos.

Re: need suggestion; for searching a word inside an html pag

Posted: Fri Feb 28, 2014 7:27 am
by gghhh456
can I also extend the search to find certain type of images... like in an group of images of bird and Can I search say "Eagle" and display the results..???