Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001122

[PHP] Regular Expression Help From: John Monfort (monfort <email protected>)
Date: 12/26/01

Hello everyone,

I'm using regular expression to extract all text within the <body> tag.
With a BODY tag like

<body bgcolor="" ... text=""> \\only interested in this line.

I use

eregi("( <body ) (.*) (\">) ",$str,$out);
\\spaces included, here, for easy reading.

echo "$out[0]";

However, this prints everything following (and including) the '<BODY'
portion of the BODY tag.

Ex.
 <body text=" "...alink="">
 <table>....</table>
 ...
 </body>
 </html>

I want it to ONLY take the text within the openning body tag. Like,
<body ... >

how do I do this? What am I missing, in the above?

eregi("(<body)(.*)(>)",$str,$out);

-Please help.

-john

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>