Okay, this is just very general info to help point you in the right
direction, but, here are some functions you'll probably need to accomplish
this:

  * Regular Expressions
  * pregi() and/or eregi()
  * explode() and implode()
  * str_replace()

Regular expressions will probably be the most important part of doing what
you need to do. If you don't already know how they work, they are hard to
grasp at first, but, very useful once you understand their purpose.

Monty


> From: [EMAIL PROTECTED] (Justin French)
> Newsgroups: php.general
> Date: Fri, 19 Jul 2002 13:50:08 +1000
> To: php <[EMAIL PROTECTED]>
> Subject: modify an element of a HTML tag within a string
> 
> Hi all,
> 
> I've asked simular questions before, but I think I'm finally asking the
> *right* question to get the right answer.
> 
> I'm look for some suggestions on the best method of parsing a HTML document
> (or part thereof), with the view of CAPTURING and MODIFYING a specific
> element of a specific tag.
> 
> something like:
> 
> 1. look for a given tag eg DIV
> 2. capture the tag (everything from '<DIV' up to the '>')
> 3. look for a given attribute (eg ID="foo", ID=foo, ID='foo' -- all valid
> ways)
> 4. capture it
> 5. be given the opportunity to manipulate the attribute's value, delete it,
> etc
> 6. place captured tag (complete with modifed elements) back into the string
> in it's original position
> 7. return to step 1, looking for the next occurence of a DIV tag
> 
> 
> I really don't know where to start.  I REALLY don't expect someone to write
> this for me, just some guidance would be great -- or maybe some inspiration
> :)
> 


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

Reply via email to