Click here to Skip to main content
15,878,852 members

Articles by fly904 (Article: 1, Tip/Tricks: 3)

Article: 1, Tip/Tricks: 3

RSS Feed

Average article rating: 4.50

Web Development
ASP.NET
22 Feb 2009   Updated: 22 Feb 2009   Rating: 4.50/5    Votes: 4   Popularity: 2.71
Licence: CPOL    Views: 21,480     Bookmarked: 28   Downloaded: 174
Please Sign up or sign in to vote.
Cache server response to reduce server load.

Average blogs rating:

No blogs have been submitted.

Average tips rating: 4.21

Programming Languages
PHP
13 Jan 2010   Updated: 22 Jan 2010   Rating: 4.75/5    Votes: 4   Popularity: 2.86
Licence: CPOL    Views: 6,150     Bookmarked: 3   Downloaded: 0
Please Sign up or sign in to vote.
You can wrap the functions into a class and use the default class life cycle to your advantage.<?phpclass Cache{ const DIRECTORY = '../cache/'; const TIME = 600; protected $cache_directory; private $using_cached_file = false; public function __construct( $cache_directory =...
25 Jan 2010   Updated: 25 Jan 2010   Rating: 4.22/5    Votes: 9   Popularity: 4.03
Licence: CPOL    Views: 13,281     Bookmarked: 4   Downloaded: 0
Please Sign up or sign in to vote.
More validation can be applied when handling default values. I am not a fan of outputing anything directly from a class, I prefer to return the links as an array. It's easier to maintain. This way, when/if you change the styling; then it saves having to trawl through your classes.<?phpclass...
22 Jan 2010   Updated: 3 Feb 2010   Rating: 3.67/5    Votes: 3   Popularity: 1.75
Licence: CPOL    Views: 4,460     Bookmarked: 2   Downloaded: 0
Please Sign up or sign in to vote.
There is a bug with your regex.Say for example that you were refered to by google.uk/search?q=example&ie=utf-8, your code would return 'example'. If, however, you were refered to by google.uk/search?q=example, it would return 'oops'.The simple fix is to change the limitation variable from...

Average reference rating:

No reference articles have been posted.

Average project rating:

No projects have been posted.
Software Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.