Jump to content

Searching HTML pages


ballouta

Recommended Posts

Hello,

 

Is it possible to search in my HTML text pages using PHP code? any link or tuorial please.

 

Thank you

 

Yes.  What exactly do you mean by search?  If you're talking about extracting specific tags, patterns etc. I can redirect you to the regex section for further help and suggestions.  Other than that you're going to have to explain the issue at hand further.

Link to comment
https://forums.phpfreaks.com/topic/170871-searching-html-pages/#findComment-901223
Share on other sites

sorry,

 

i have may html pages that contain text, i want to searc for specific word or sentence in those HTML pages because they are not in mysql database yet.

can PHP read the text in HTML pages and search for specific word or sentence.

 

I do NOT want to include google search code or smthg like this in my website.

 

Thanks alot

Link to comment
https://forums.phpfreaks.com/topic/170871-searching-html-pages/#findComment-901235
Share on other sites

the strstr and stristr function sound like they could do what you want. These functions find the first occurence of a string (your search) inside another string (your html document)

 

strstr is case sensitive while stristr is case insensitive.

 

http://www.w3schools.com/PHP/func_string_stristr.asp (stristr)

 

beyond that, you should probably look into regex of some kind

Link to comment
https://forums.phpfreaks.com/topic/170871-searching-html-pages/#findComment-901237
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.