| |||||||||||
| |||||||||||
A taster PHP expression ...
I've been working on RSS feeds ... looking to get a page that combines various blogs so that I can have a quick look and see where we stand without having to hop and skip round each in turn. And with magpierss, it's turned out to be quite easy.
Yet some blogs give a summary in the their RSS feeds - a taster, if you like, which is exactly what I want and others spew out the full text, including tags too. How to eliminate the tags, and shorten the text? Well remember that in PHP, there's function to do it $st = strip_tags($wehave[atom_content]);Can you work out my regular expression? It's returning just the first 190 characters of the incoming string ... or a few more up to the following space if it had to gieva good word bread ... followed by 3 dots. But if the incoming string is not as long as 190 characters, it's returned in its entirety. You can see my work (so far) at http://www.wellho.net/web2/index.html (written 2007-09-30 17:56:32) Associated topics are indexed under H107 - String Handling in PHPQ803 - Object Orientation and General technical topics - Regular Expressions - Extra Elements
Some other Articles
Choosing between mod_proxy and mod_rewritePython v Ruby Maidenhead Coffee Challenge New Month, New Quarter, New Laws A taster PHP expression ... Hotel in Melksham at Christmas Apache Tomcat Performance Tuning One business, four different angles! Getting the local voice heard korn tips - some useful korn shell techniques 1636 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||