You are here: Search and replace...xxx ago. How? « PHP Programming Language « IT news, forums, messages
Search and replace...xxx ago. How?

Posted by FFMG on 07/19/07 15:03

Hi,

I have some cached pages and I want to display how long ago certain
articles were written.

But how can I display "This article was written 'yyy days' ago" when
the whole page is cached?

I cannot do a simple search and replace as I would need to know when
the articles were written to compare them with the current time, (I
have more than one article with different dates saved in the pages).

I was thinking of tags, something like '<%article date=xxxxx>'.
And preg_replace( "/<%article date=(xxx)>/", ('yyyy'), $data );

But how can I use the 'xxx' to calculate the 'yyy'?

How else would you do it?

Many thanks

FFMG


--

'webmaster forum' (http://www.httppoint.com) | 'webmaster Directory'
(http://www.webhostshunter.com/) | 'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php)
'Free URL redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=18563

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация