ballouta Posted August 18, 2009 Share Posted August 18, 2009 Hello, Is it possible to search in my HTML text pages using PHP code? any link or tuorial plz. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/170871-searching-html-pages/ Share on other sites More sharing options...
Maq Posted August 18, 2009 Share Posted August 18, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/170871-searching-html-pages/#findComment-901223 Share on other sites More sharing options...
ballouta Posted August 18, 2009 Author Share Posted August 18, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/170871-searching-html-pages/#findComment-901235 Share on other sites More sharing options...
mikesta707 Posted August 18, 2009 Share Posted August 18, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/170871-searching-html-pages/#findComment-901237 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.