pantinosm Posted November 21, 2006 Share Posted November 21, 2006 Hi everyone. I am new to php so i be patient. I have a mysql db and i use a recordset to manipulate it.I have a table in html and i try to fill it with data. The problem is that a field is a url link with no spaces that causes my page to break.So i need somehow to show only the start of the link and then ... like yahoo lets say.My problem can be seen here [url=http://www.ibeba.com/world/worldsearch.php?txtsearch=art&Submit=Search+Her]http://www.ibeba.com/world/worldsearch.php?txtsearch=art&Submit=Search+Her[/url]Thank you in advance. Quote Link to comment Share on other sites More sharing options...
taith Posted November 21, 2006 Share Posted November 21, 2006 [code]$text= "reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreally long word";wordwrap($text, 20, "<br />\n");[/code] Quote Link to comment Share on other sites More sharing options...
taith Posted November 21, 2006 Share Posted November 21, 2006 i also wrote this pretty little function[code]<?function filter_charlimit($string, $length="50"){ if(strlen($string)<$length) return $string; else return trim(substr($string, 0, $length)).'...';}?>[/code] Quote Link to comment Share on other sites More sharing options...
pantinosm Posted November 21, 2006 Author Share Posted November 21, 2006 Thank you so much. That works great. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.