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 ... 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)."..."; 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 Link to comment https://forums.phpfreaks.com/topic/114524-solved-wordwrap-kinda-problem/#findComment-588911 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.