Get Percentage Function PHP

Sometimes we need to calculate the percentage of certain value in our project. In that circumstances you can use following PHP snippet to do that task.echo get_percentage(10, 100); //usage function get_percentage($percentage, $of) { //courtesy : http://stackoverflow.com/a/14880194 $percent = $percentage / $of; return number_format( $percent * 100, 2 ) . '%';; }

Working with PHP Sessions

PHP $_SESSION is basically variable that stores temporary information about current user, for example you are browsing a website, but the remote server doesn’t really know who you are, only way to identify current user assessing the site is using session, PHP $_SESSION allows us to store information about the user, which can be retrieved later from any page within the site, as long as the session is active.

Resize Multiple Images in a Folder using PHP

Sometimes we need to resize multiple images in a folder, using PHP script we can achieve just that. Just point to folder where your images are located and execute following PHP script to resize your images.

Paypal Instant Payment Notification (IPN)

This is continuation of the previous post how to setup Paypal Express Checkout in your website. In my experience, you do not necessarily need to setup Paypal Instant Payment Notification (IPN), but if want to automate tasks and keep track of customer actions back in their PayPal account, you should create and setup an IPN listener script.