472,142 Members | 1,113 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

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 2309

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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.