SitePoint Sponsor

User Tag List

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

    Auto replacing elements

    hi,

    Ive been using the Google search API for my site, the problem that i am having is the results getting return are not in a valid xhtml form... For instance it returns <br> instead of <br />...

    Is there anyway of checking this on the fly to replace these rouge elements? Normally i would live with it, but the site it is for requires valid xHTML throughout...

    Cheers

    cg1bbons.

  2. #2
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry to answer my own problem, but just found the str_replace function ( )

    Used it in the following way:

    Code:
    $str = $snippet;
    $str = str_replace("<br>", "<br />", $str);
    Cheers

    cg1bbons.


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
  •