RE: [PHP] eregi help for <body...></body>
| From: | Jeremy Simon | Date: | Fri, 08 Dec 2000 19:49:32 +0000 |
| Subject: | RE: [PHP] eregi help for <body...></body> | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29394@lists.php.net to get a copy of this message | ||
I fixed my own problem, here is the code I used to accomplish my task:
function inStringSub($string) {
eregi("<body[^>]*>(.*)</body>",$string,$result);
return($result[1]);
}
-----Original Message-----
From: Jeremy Simon [mailto:jeremy@safessl.com]
Sent: Thursday, December 07, 2000 6:01 PM
To: php-general@lists.php.net
Subject: [PHP] eregi help for <body...></body>
I need some help with with trying to eregi a file for the <body
bgcolor="#000000"> to the </body>.
My basic code will search for the <body> tag to the </body> tag and return
it. The problem is that I don't have just a simple <body> tag I have a <body
bgcolor="#000000" text="#FFFFFF">. I need a way to have it search for the
"<body" to the first ">" then go the (.*)</body>.
<--Begin Paste --->
function inStringSub($string) {
eregi("<body(.*)</body>",$string,$result);
return($result[1]);
}
<---End Paste --->