Displaying feed with the correct html character entities
I have feed that's already broken down into the content I need. Part of that content contains things such as &\;
and "\;
.
I'm using PHP's str_replace()
to find and replace them to be their correct html character entities (ex. &
). However, it won't find this:
$find = array('&\;', '"\;', '\;');
And I would replace them like this:
$replace = array('&'开发者_开发问答, '"', ';');
What am I missing in order for the function to find them?
<ul>
<li>Story Time with Captain Fishbones</li>
<li>Flashback</li>
<li>The Office</li>
<li>The Life &\; Music of Ella Fitzgerald</li>
<li>Circus in the Park</li>
<li>Symphonicity</li>
<li>Wreck of the Dictator</li>
<li>Fireworks</li>
</ul>
<h3>Thursday, Aug 12</h3>
<ul>
<li>Historic Villages Tour</li>
<li>The Janitors</li>
<li>Mitchell'\;s Mayhem</li>
<li>"\;1607 First Landing"\; by Chip Fortier</li>
<li>Adam Queen followed by Randy Hermoso</li>
<li>The Life &\; Music of Ella Fitzgerald</li>
<li>Shipwrecks and Ghost Lore</li>
<li>Black White Blues</li>
<li>Wreck of the Dictator</li>
</ul>
Use html_special_chars() to print the content. Also I think that your $find variable has wrong escape sequences.
精彩评论