DeanWhitehouse Posted July 13, 2008 Share Posted July 13, 2008 I have this code <?php $sql = "SELECT * FROM news ORDER BY time DESC"; $query = mysql_query($sql); while($rows = mysql_fetch_array($query)) { $cont = wordwrap($rows['content'],3,"..."); echo $cont; } ?> and this outputs, hel...ooo...this... etc. how can i have it do hel... and stop after the ... Quote Link to comment https://forums.phpfreaks.com/topic/114524-solved-wordwrap-kinda-problem/ Share on other sites More sharing options...
teynon Posted July 13, 2008 Share Posted July 13, 2008 $cont=substr($rows['content'], 0, 3)."..."; Quote Link to comment https://forums.phpfreaks.com/topic/114524-solved-wordwrap-kinda-problem/#findComment-588909 Share on other sites More sharing options...
DeanWhitehouse Posted July 13, 2008 Author Share Posted July 13, 2008 thanks Quote Link to comment https://forums.phpfreaks.com/topic/114524-solved-wordwrap-kinda-problem/#findComment-588911 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.