tibberous Posted November 4, 2006 Share Posted November 4, 2006 Just a literal <. I can search for it, but if I search for anything after the <, such as <html, it breaks the search.I read that it was only special in PHP, which I think is why I can't find it anywhere.Thanks Quote Link to comment Share on other sites More sharing options...
Orio Posted November 4, 2006 Share Posted November 4, 2006 Can you give an example to what you mean?Orio. Quote Link to comment Share on other sites More sharing options...
tibberous Posted November 5, 2006 Author Share Posted November 5, 2006 Sure. Lets say I want to search an html file for all instances of <h.preg_match_all("/<h/", "<html><head><title>", $matches);This doesn't work, I think because php treats < as a special character, even though it normally isn't. I have tried \<, <<, \\<, '<, [<] and anything else I could think of, but no matter what it doesn't return any results. Quote Link to comment Share on other sites More sharing options...
Nicklas Posted November 5, 2006 Share Posted November 5, 2006 It works, you have to view the source to see the contents in $matches[code=php:0]preg_match_all("/<h/", "<html><head><title>", $matches);print_r($matches);[/code] Quote Link to comment Share on other sites More sharing options...
tibberous Posted November 6, 2006 Author Share Posted November 6, 2006 ROFL!Yes... yes you do...Wow.Thats the best error I ever had - never even crossed my mind.Thanks Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted November 7, 2006 Share Posted November 7, 2006 couldn't you use the fgetc(); function? Quote Link to comment 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.