/ Published in: PHP

This will search for specific type of tag in html doc and extract type attribute value and all attributes after it in tag.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$data = '<html> <body> <jdoc:include type="head" name="popup" style="raw" /> <jdoc:include type="modules" name="dochead" style="raw" /> </body> </html>'; { Will return $matches = [0][0] = "<jdoc:include type="head" name="popup" style="raw" />" [0][1] = "<jdoc:include type="modules" name="dochead" style="raw" />" [1][0] = head [1][1] = modules [2][0] = name="popup" style="raw" [2][1] = name="dochead" style="raw" }
Comments
