"&" in feed?

Discussion in 'XML & RSS' started by login, Sep 23, 2008.

  1. #1
    I want to edit my feed code:
    <link>http://www.mineoppskrifter.no/view_recipe.php?id=<?=$result['id'];?></link> 
    to 
    <link>http://www.mineoppskrifter.no/view_recipe.php?id=<?=$result['id'];?>&<?=$result['name'];?></link>
    Code (markup):
    I cannot use "&". What can I use instead to get an output of that character?
     
    login, Sep 23, 2008 IP
  2. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to escape the & by substituting &amp; (this should always be done for XML/XHTML Markup)

    Thus:

    <link>http://www.mineoppskrifter.no/view_recipe.php?id=<?=$result['id'];?>&amp;<?=$result['name'];?></link>

    James
     
    jamesicus, Sep 23, 2008 IP
    login likes this.
  3. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #3
    That worked, great :)
     
    login, Sep 23, 2008 IP