RegExp Tags and Text Oh My
| From: | Some Guy | Date: | Mon, 17 Jul 2000 17:07:52 +0000 |
| Subject: | RegExp Tags and Text Oh My | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-6934@lists.php.net to get a copy of this message | ||
Ok I have a couple of unrelated scripts but 2 problems
that are related. I am using PHP4
First problem grabbing text between 2 tags looks like this
<SOMETAG>TEXT</SOMETAG>
How do I capture the text between the 2 tags into a variable
the text might span more than 1 line but will usually only
be 1 or 2 words but could be 100s of words
Problem 2. I have a variable that has some stuff in it and
want to place it in place of a tag set.
This is sort of a template. I have a html file that has
a set of tags and want to repalce the set of tags and
anything between them with the contents of the variable
as Im presenting it to the browser client.
variable contents
$hello = "Hello World<BR>\n";
contents of html file
<HTML>
<BODY>
<SOMETAG>SOMETEXT</SOMETAG>
</BODY>
</HTML>
I want the browser to recieve
<HTML>
<BODY>
Hello World<BR>
</BODY>
</HTML>
without changing the contents of the html file
any help or hints would be great
thanks in advance
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com