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