Jump to content

How do I search for '<' ?


tibberous

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/26150-how-do-i-search-for/#findComment-119820
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.