Tag: preg_match
-
preg_match() matching quotes – How to escape quotes
I was having the most difficult time getting preg_match() to match a double quote. $string = ‘<a href=”https://www.calcmaster.net/” class=”link”>calcmaster.NET</a>’; if ( preg_match(‘/src=”(.+?)”/’, $string, $matches) ) { $url = $matches[1]; } This did not work for me. I assumed that the source string may have had some unicode characters for the double quotes so I converted…