469,934 Members | 2,607 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

shorter the text

Ace
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">&nbsp;</td>

Dec 18 '06 #1
3 2283

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">&nbsp;</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."...";

?>

Dec 18 '06 #2

ja*****@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">&nbsp;</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

Dec 18 '06 #3
Ace
very helpful...thanks
strawberry ¼g¹D¡G
ja*****@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">&nbsp;</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
Dec 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jonathan Moss | last post: by
16 posts views Thread by Krakatioison | last post: by
3 posts views Thread by jb0002 | last post: by
8 posts views Thread by Servé Lau | last post: by
15 posts views Thread by Mik0b0 | last post: by
3 posts views Thread by skanemupp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.