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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PHP string replace issue

  • 13-05-2005 6:14pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 9,280 ✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    htmlspecialchars() or htmlentities()


Advertisement