In: PHP
23 Nov 2011Tweet PHP fluent interfaces have been around for quite some time. They are often used just for chaining methods of an object so that we get nice readable code. Good fluent interface takes a while to build, and will take some planning to make object methods work seamlessly. However, if you still haven’t experienced the [...]
In: PHP
12 Apr 2011Tweet Have you ever wondered if you could let user see his website visits on his own admin page without having to leave backend of his system? I have… Actually – the CMS I made for my clients (written in Zend Framework) has this option for quite some time, and users love it. So – [...]
In: PHP
29 Dec 2010Tweet Get number of Twitter followers using this PHP snippet is easy. Once you get all the data from Twitter, you just have to isolate followers_count. Besides followers count, you can extract following data as well: id name screen_name location description profile_image_url url friends_count created_at lang Now, finally, to get number of Twitter followers, use [...]
In: PHP
16 Dec 2010So, almost every website needs contact form – is it a real contact form or just a feedback from your users. We need to make a contact form as easy to deal with as possible.
In: PHP
4 Nov 2010Tweet This is an example how PHP download counter could be made. This is just a basic but still functional example. So, in order to make a download counter we shall need three scripts: download_file.php download_count.php show_download_number.php First part of our PHP download counter script will be replacing actual file that should be downloaded, and [...]
In: PHP
27 Oct 2010Tweet Script authors: Drasko Gomboc and Sankovic Marko. When running automated backup it is a good practice to save exact time when you made backup in your file name. This snippet shows you how to automatically add date and time before extension in your file name. 1 2 3 $filepath = ‘/backup/folder/drasko_gomboc-and-sankovic_marko.txt’; $new_filepath = preg_replace("/(.[^.]*)$/", [...]
Tweet So, let’s say you are about to launch your new website. You have written it and tested in localhost, and it is time to go live! Only… not in the public yet. You want to adjust some more things, and check if your website is working correctly, and you don’t want users to see [...]
In: PHP
29 Sep 2010Tweet With PHP function similar_text(), you can offer your users a Google like “Did you mean” suggestion to a misspelled word. All you need is a word by word comparison using a PHP function similar_text. See and use snippet below in order to find most similar word to the one you choose. 1 2 3 [...]