SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    parsing html using DOM or Regex or ...

    Hello forum,
    I'm trying to manipulate some html like:

    <p>
    a paragraph
    </p>

    and return:

    <p>
    <span class="word">a</span><span class="word">paragraph</span>
    </p>

    I would like to perform this operation on all textnodes excluding text between script tags.

    I can make this happen(more or less) with javascript. But I'm not sure of the best approach with PHP. It seems like many of the functions I would use(getElementsByTagName, etc) are only available via CVS and not on my host.

    Can anyone recommend a method for accomplishing this?

    Thanks

  2. #2
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never mind. Error in my PHP code.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •