RE: [PHP] replacing & but not special chars

2003-07-28 Thread Jeff Harris
On Jul 28, 2003, "Ford, Mike [LSS]" claimed that: |> -Original Message- |> From: Shawn McKenzie [mailto:[EMAIL PROTECTED] |> Sent: 27 July 2003 08:36 |> |> I have some URLs in hrefs that have an &. This does not |> validate HTM4.01 |> transitional, so I want to replace them

RE: [PHP] replacing & but not special chars

2003-07-28 Thread Ford, Mike [LSS]
> -Original Message- > From: Shawn McKenzie [mailto:[EMAIL PROTECTED] > Sent: 27 July 2003 08:36 > > I have some URLs in hrefs that have an &. This does not > validate HTM4.01 > transitional, so I want to replace them with & > > So I buffer the output and do a replace, but suppose there

Re: [PHP] replacing & but not special chars

2003-07-27 Thread Andrew Brampton
How about you decode the string, and then encode it like so: $decode = html_entity_decode($input); $output = htmlentities($decode); If you have the string ab&something&blah the decode will turn that into ab&something&blah and then encode it into ab&something&blah This can run into problems, but t