Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.