View Single Post
  #3  
Old 03-20-2008, 09:13 PM
Watdaflip's Avatar
Watdaflip Watdaflip is offline
Brigadier General
 
Join Date: Sep 2005
Location: Cincinnati, Ohio
Posts: 1,638
Default Re: Adding to php code

The easier way is to cut it off after a character limit, to do that do something like..

PHP Code:
$max_char 50;
if(
strlen($row['posting_discription']) >= $max_char)
{
$row['posting_discription'] = substr($row['posting_discription'], 0$max_char)."...";

That will cut it off at 50 characters and add ... to the end.

As far as formatting the color, you just add html to the strings... like
PHP Code:
$sometext "<span style=\"color: #FF0000\">Red text</span>"
__________________

Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Reply With Quote