Oh great and all powerful deities of PHP... :eheh:
I need a way to inject a little HTML text into an HTML "page" (it's an email actually, but not important) just after the opening body tag (so "<body><p>" becomes "<body>Insert text here.<p>"), but I want it to work whether the opening body tag is "<body>" or "<body class='irregardless' id='a-whole-nuther' style='all-of-a-sudden'>" or anything else in that general area. The HTML is all in a single variable, so I just need something that does a needle/haystack replace (case insensitive) in all cases.
I've successfully used str_ireplace against just "<body>" without any problems, but my preg-fu doesn't extend to catching all cases. Help?
I need a way to inject a little HTML text into an HTML "page" (it's an email actually, but not important) just after the opening body tag (so "<body><p>" becomes "<body>Insert text here.<p>"), but I want it to work whether the opening body tag is "<body>" or "<body class='irregardless' id='a-whole-nuther' style='all-of-a-sudden'>" or anything else in that general area. The HTML is all in a single variable, so I just need something that does a needle/haystack replace (case insensitive) in all cases.
I've successfully used str_ireplace against just "<body>" without any problems, but my preg-fu doesn't extend to catching all cases. Help?