Hello all,

I am trying to add html code using php on the fly while uploading web pages
to our database.  All of my replace functions seem to work well except one.
I am trying to add a <table> tag after the body tag.  It is easy to find
the body tag because there is only one "<body" in an html document. I am
having a terrible time trying to find the end of the tag because it has
unknown length and contents, but it does end with a ">". So here is what
I've tried:

$filedata = eregi_replace("<body(.*)>","<body\\1><table border=0 
width='80%'>",$filedata);

This line of code happily adds the <table border=0 width='80%'> at the end
of the document. eregi_replace uses a case insensitive matching. The reg
exp is matching the entire $filedata rather than stopping at the first ">"
after "<body". How do I get it to stop at the first ">" after "<body"?

What am I doing wrong?

Thank you,

-- 


Eric Dean  [EMAIL PROTECTED]
Chief Curator, Office of Visual Materials
School of Art and Art History, University of Iowa

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to