Re: [PHP-DB] Formatting txt from a database

2002-12-12 Thread Matt Vos
$select="select fields from table..."; $sres=mysql_query($select); echo mysql_error(); while ($srow=mysql_fetch_row($sres)) { $string=$srow[0]; $no_html=strip_tags($string); if (strlen($no_html) > 30) $no_html=substr($no_html,0,30)."..."; echo("$no_html"); } Matt - Original Mes

Re: [PHP-DB] Formatting txt from a database

2002-12-12 Thread DL Neil
Lisi, To save reinventing the wheel would strip_tags() be any use to you? (see manual) =dn > I am retrieving text stored in a database, and I want to strip out any HTML > tags and then only display the first 30 characters with "..." to show the > user that there is more text to view. > > My probl