I just cant get this little function to format this text string correctly, the function should format and get rid of the brake beteen ')'and 'this' so it would read all on one line, eg -
"Janome Mystyle22 (model 2522) This sewing machine has a top lading bobbin blar blar"
// text string as it is held in the data base as below with no html code
"Janome Mystyle22 (model 2522)
This sewing machine has a top lading bobbin blar blar"
// the function i'm using
function add_quotes($text) {
//first, strip html (if any)
$text = strip_tags($text);
//double each existing quotation mark
$text = str_replace("\"", "\"\"", $text);
//strip unneeded white space
$text = trim($text);
//trim down description to 180 characters
$text = substr($text, 0, 180);
//and finally surround the result with quotation marks
$text = "\"".$text."\"";
//return the result
return $text;
Any help would be good. Colin