473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 2334

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jonathan Moss | last post by:
I am currently working on a StructuredText interpreter for PHP. The current task in inline parseing of markup. for example looking in a plain text block and finding the sections that should be...
16
by: Krakatioison | last post by:
My sites navigation is like this: http://www.newsbackup.com/index.php?n=000000000040900000 , depending on the variable "n" (which is always a number), it will take me anywhere on the site......
3
by: jb0002 | last post by:
Just making a site with a text input, and it looks big and clumsy. Hotmail's boxes when I compose a message are not as tall, and make th design look more sleek. I'm assuming this is a css thing,...
8
by: Servé Lau | last post by:
Sometimes I code like this: char *p = strchr(buf,'\n'); if (p) *p = 0; But I've also seen the shorter expression: buf = 0;
15
by: Mik0b0 | last post by:
Hallo everybody, my problem is: there are two single-dimension arrays, longer and shorter, every array is organized in ascending order. We need to build a new array out of two. This is what I...
1
by: Daikide | last post by:
I need average for my program. And I'm using it multiple time in my program. I'm doing this in PVSS: So say average float is 2.0013005 (FOR EXAMPLE) but the number in the end can be higher......
43
Death Slaught
by: Death Slaught | last post by:
I have made a music player in a pop up with JavaScript. It uses frames to write the object into an unseen page. Here's an example of the page the user first sees. <!DOCTYPE html PUBLIC...
3
by: skanemupp | last post by:
is there anyway to make this shorter? i hate having these big blocks of similar-looking code, very unaesthetic. maybe doesnt matter good-code-wise? anyway can i make some function that makes this...
4
by: raylopez99 | last post by:
Please consider the below and how to make name references shorter-- there has to be a way. RL using System; namespace MyNamesSpace1 { class ManagerClass
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.