str_replace help


Posted on 16th Feb 2014 07:03 pm by admin

Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean up bad html to valid xhtml, I am using:

Did you know?Explore Trending and Topic pages for more stories like this.
Code: $pee = str_replace('&', '&', $pee);
It works, but doesn't change & to &amp; when the content is inside of <blockquote><p>stuff here & there</p></blockquote>

can anyone assist?
No comments posted yet

Your Answer:

Login to answer
273 Like 24 Dislike
Previous forums Next forums
Other forums

Format timestamp from mysql
When I tried this:
Code: date("m/d/Y H:i A", $row['timestamp'])
I got 12/31/1969 18:

date("now") prints out wrong date ?
Hi Guys
Anyone know why and how I can fix it ?

Passing PHP variables from one page to another
Hello-

I'm having trouble figuring out how to transport a variable from one php file to anoth

New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

Strange cookie problem. setcookie dependant on where user was directed from?
Hello,

I have a website that sets a cookie when a user visits the website. The cookie holds a

Array disappearing in foreach loop
Okay, I have this problem where an array will become undefined in a foreach loop.

Here is the

Solution to the FindControl problem
I have seen may posts about having problems with the FindControl method. Most seem to come about bec

Strange PHP/mySQL error ... am I just tired?
Code: <?

## CONNECT TO DB FUNCTION!
function ConnectTo($db2con)
{
$hostNam

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash