Advertisement

08.15.2008 at 09:37AM PDT, ID: 23651820 | Points: 500
[x]
Attachment Details

A php Function that takes HTML as input and outputs a text only summary of variable length

Asked by Matt_T_hat in PHP Scripting Language

Tags: ,

I am writting a class that will help me to cope with the ammount of XML feeds in my niche. I need a function that might get called in theory as many as 1000 times but might be called an average of 40 times (per page request).

As such I am looking for efficiency.

The function will take the following inputs: text (HTML formatted), length (in characters).

It should output text without HTML that is length characters long but it should not break in the middle of a word. Also the text should have added to the end three full stops like this..

This output should also be XML safe without using cdata so things like £ & and friends need to remain (HTML encoded/escaped).

Hopefully this makes sense.

Help, tips or an outright solution appriciated. I'll assume anyone is free to use any code given in anyway desired unless you say otherwise.Start Free Trial
 
Loading Advertisement...
 
[+][-]08.15.2008 at 09:42AM PDT, ID: 22239689

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2008 at 10:50AM PDT, ID: 22240253

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.15.2008 at 08:20PM PDT, ID: 22242940

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2008 at 08:25PM PDT, ID: 22242950

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.16.2008 at 02:08AM PDT, ID: 22243593

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628