logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$10
get_content - remove all additional white space


Hello,

I am trying to remove all multiple white spaces from get_content();

But in my html post editor I just have some extra white spaces, and there are no &nbsp characters, but in the output of the get_the_content, there additional &nbsp replacing the additional white space.

So I tried this...

<?php 
$termsConditions = str_replace('&nbsp'," ",get_the_content());
echo preg_replace('/\s+/',' ',$termsConditions);
?>


But still there are multiple
&nbsp
are in my text.

How are these being generated? or why is my php above not working?

Can anyone help please.


Thanks



This question has been answered.

Josh Cranwell | 01/25/13 at 5:38pm Edit
Tutorial: How to assign prize money


(7) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

This question has expired.



John Cotton, Josh Cranwell, Arnav Joy, Dbranes, Naveen Chand voted on this question.



Current status of this question: Completed



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.