Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Display a few sentences then having ...read more

Explorer ,
Feb 15, 2007 Feb 15, 2007
DW8/PHP/MySQL

I am wanting to know how I can have only the first two or the sentences display out of a multi paragram description followed by ...read more
TOPICS
Server side applications
258
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 16, 2007 Feb 16, 2007
newhorizonhosting.com wrote:
> DW8/PHP/MySQL
>
> I am wanting to know how I can have only the first two or the sentences display out of a multi paragram description followed by ...read more

Computer languages don't understand the concept of a sentence, so you
need to build a function to do it for you. The technique is explained in
detail in Chapter 11 of my book "Foundation PHP for Dreamweaver 8".

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 18, 2007 Feb 18, 2007
LATEST
David Powers wrote:

> newhorizonhosting.com wrote:
>
>> DW8/PHP/MySQL
>>
>> I am wanting to know how I can have only the first two or the
>> sentences display out of a multi paragram description followed by
>> ...read more
>
>
> Computer languages don't understand the concept of a sentence, so you
> need to build a function to do it for you. The technique is explained in
> detail in Chapter 11 of my book "Foundation PHP for Dreamweaver 8".
>

The "read more" requirement would suggest a client side solution.

[javascript]
var NumberOfSentences=3,
str="blah blah",
Long= str.replace(/[\n\r]/g,"").split(/\. /);
var Short=S.slice(0,NumberOfSentences).join(". ");

Untested.
Mick
Mick

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines