Hello all, My website pulls entries from a forum and shows them on the entry page but sometimes the post has a word in it that is over 200 characters. The problem is that IE doesnt split the string, it shows it as one line there by messing up my layout and making the entire page look bad. I need a way of filtering out these long words from a string and replacing them with "" or split after each section of 50 or what ever else you guys suggest. Thanks for the help!
$raw_snippet = "what you got from the database"; $words_array = explode(" ", $raw_snippet); $safe_snippet = ""; foreach ($words_array as $word) { if (strlen($word < 200)) { $safe_snippet .= $word; } else { $safe_snippet .= substr($word, 0, 200); //discard the rest or just split it up and add a space etc. } } echo $safe_snippet; PHP: You'll have to check I implemented the fucntion arguments in the correct order. if only I had known that existed...