shorter the text
Dear all
I have a databse and php page...I would like retrieve a database to PHP
page..but i don't want show the all text ...just want as like as little
description (like Apple is ... ... ) and now is display all text like
Apple is red, please teach mw how to do it...
my script:
<td width="348" align="left" bgcolor="#FFFFFF" class="content"><a
href="../whatnews_details.php?news_id=<?php echo
$row_news_summary['news_id']; ?>" target="_parent"><?php echo
$row_news_summary['news_description']; ?></a></td><td width="10"
bgcolor="#FFFFFF" class="content"> </td>
Re: shorter the text
Ace schreef:
> Dear all
>
> I have a databse and php page...I would like retrieve a database to PHP
> page..but i don't want show the all text ...just want as like as little
> description (like Apple is ... ... ) and now is display all text like
> Apple is red, please teach mw how to do it...
>
> my script:
> <td width="348" align="left" bgcolor="#FFFFFF" class="content"><a
> href="../whatnews_details.php?news_id=<?php echo
> $row_news_summary['news_id']; ?>" target="_parent"><?php echo
> $row_news_summary['news_description']; ?></a></td><td width="10"
> bgcolor="#FFFFFF" class="content"> </td>
You could try something like this code :
<?php
$variabele = \"like Apple is all over the place.\";
$variabele = substr($variabele,0,10);
// $variabele = \"Like Apple is\"
echo $variabele."...";
?>
Re: shorter the text
jannezz [at] gmail.com wrote:
> Ace schreef:
>
> > Dear all
> >
> > I have a databse and php page...I would like retrieve a database to PHP
> > page..but i don't want show the all text ...just want as like as little
> > description (like Apple is ... ... ) and now is display all text like
> > Apple is red, please teach mw how to do it...
> >
> > my script:
> > <td width="348" align="left" bgcolor="#FFFFFF" class="content"><a
> > href="../whatnews_details.php?news_id=<?php echo
> > $row_news_summary['news_id']; ?>" target="_parent"><?php echo
> > $row_news_summary['news_description']; ?></a></td><td width="10"
> > bgcolor="#FFFFFF" class="content"> </td>
>
> You could try something like this code :
>
> <?php
> $variabele = \"like Apple is all over the place.\";
> $variabele = substr($variabele,0,10);
> // $variabele = \"Like Apple is\"
>
> echo $variabele."...";
>
> ?>
look for "ellipsis" on the following page:
http://uk.php.net/preg_replace
Re: shorter the text
very helpful...thanks
strawberry =BCg=B9D=A1G
> jannezz [at] gmail.com wrote:
>
> > Ace schreef:
> >
> > > Dear all
> > >
> > > I have a databse and php page...I would like retrieve a database to P=
HP
> > > page..but i don't want show the all text ...just want as like as litt=
le
> > > description (like Apple is ... ... ) and now is display all text like
> > > Apple is red, please teach mw how to do it...
> > >
> > > my script:
> > > <td width=3D"348" align=3D"left" bgcolor=3D"#FFFFFF" class=3D"content=
"><a
> > > href=3D"../whatnews_details.php?news_id=3D<?php echo
> > > $row_news_summary['news_id']; ?>" target=3D"_parent"><?php echo
> > > $row_news_summary['news_description']; ?></a></td><td width=3D"10"
> > > bgcolor=3D"#FFFFFF" class=3D"content"> </td>
> >
> > You could try something like this code :
> >
> > <?php
> > $variabele =3D \"like Apple is all over the place.\";
> > $variabele =3D substr($variabele,0,10);
> > // $variabele =3D \"Like Apple is\"
> >
> > echo $variabele."...";
> >
> > ?>
>
> look for "ellipsis" on the following page:
>
> http://uk.php.net/preg_replace