View Single Post
Old 05-15-2013, 03:22 PM  
helterskelter808
So Fucking Banned
 
Industry Role:
Join Date: Sep 2010
Posts: 3,405
Quote:
Originally Posted by mkx View Post
sorry im still a bit confused, tried this with no luck =

<?php
$x = str_replace(array("\r\n","\r"),"",$x);
$x = strip_tags($hi->hello);
print $x ?>
Why would that work? What is $x? And what tags are you stripping? Try this:

Code:
<?php 
$hi->hello = "hello how
are you";
$one_line = trim(preg_replace('/\s+/', ' ', $hi->hello));
print $one_line; 
?>
helterskelter808 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote