php echo

Discussion in 'Programming' started by dean5000v, Mar 13, 2008.

  1. #1
    i am doing a simple echo statement in php like

    
    echo " the price is £.5.00 ";
    
    PHP:
    but it keeps changing the pound sign and i've tried escaping the character with a backslash but doesn't wont, can someone help ta.
     
    dean5000v, Mar 13, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    It changes it to what? Try using £ instead.
     
    nico_swd, Mar 13, 2008 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    As above, you should use the code for special symbols... that said, you may also want to check the character set encoding for your page if it isnt working with a normal typed pound sign - on a separate note, whats the . for between the £ and the 5 ?
     
    AstarothSolutions, Mar 14, 2008 IP
  4. whiteblue1942

    whiteblue1942 Peon

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #4
    pit it in single ' instead of double " itll will fix ur problem! double " interpret variables too but single ' read it liek it is no matter what!
     
    whiteblue1942, Mar 14, 2008 IP
  5. InFloW

    InFloW Peon

    Messages:
    1,488
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I assume your code is being sent to the browser which in case it does not recognize the ASCII code for that symbol. For HTML you need to use the &pound simple as others have suggested.
     
    InFloW, Mar 14, 2008 IP