View Single Post
Old 05-15-2013, 04:16 PM  
Dankasaur
So Fucking Fossilized
 
Industry Role:
Join Date: Sep 2011
Posts: 1,432
Quote:
Originally Posted by sarettah View Post
replace is the easiest way. However, in this case it would seem to me that there is some disagreement on what needs to be replaced. The OP says the phrase comes out on 2 lines. If it is an html presentation that would indicate that there is a <br> in the phrase. If it is a text presentation that would indicate that there is a carriage return/linefeed in the phrase.

If he needs to get rid of a <br> then strip_tags does that or you could include it in a replace. If he needs to get rid of a carriage return/linefeed then the replace can do that. Since we don't know exactly which needs to be done then a solution like dankasaur's that covers both possibilities will work.

A one line solution would be like

<?php print str_replace(array("\r\n","\r","<br>")," ",$hi->hello); ?>

.
Bingo.
Dankasaur is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote