Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP string replace issue

Options
  • 13-05-2005 7:14pm
    #1
    Registered Users Posts: 252 ✭✭


    Hi

    im using

    str_replace("&", "&", $row->text);

    but this even changes the &'s in   to  

    which is not exactly what i want

    I just want to change the &'s . Anyone know can this be done???


    Tnx


Comments

  • Registered Users Posts: 9,196 ✭✭✭RobertFoster


    Generally ampersands are are written in text like & this - with a space before and after, aren't they? Why not try:

    str_replace(" & ", " & ", $row->text);

    Just a thought...though I'm sure someone else will come up with a better solution :o


  • Registered Users Posts: 252 ✭✭ConsultClifford


    Generally ampersands are are written in text like & this - with a space before and after, aren't they? Why not try:

    str_replace(" & ", " & ", $row->text);

    Just a thought...though I'm sure someone else will come up with a better solution :o


    yip thats what i tryed just after posting... seems to be working fine.

    Tnx anyhow!


  • Registered Users Posts: 4,003 ✭✭✭rsynnott


    htmlspecialchars() or htmlentities()


Advertisement