How to create CSV file using PHP

CSV (comma-separated values) is one of the most popular methods for transferring tabular data between applications. Lot of applications want to export data in a CSV file. In this article we will see how we can create CSV file using PHP. We will also see how to automatically download the file instead of just showing it in the browser or giving the user a link to download it.
Read more »

How to sort a multi-dimension array by value in PHP

In this article we will see how to sort a multi-dimension array by value of one of the keys of the array. We can use a few different methods to do this. One way to to use usort() function. Another way is to just identify the values and create another array with the values and then use it in the array_multisort() function. Using the multisort method we can easily sort a multi-dimension array based on its one or more values. Lets see how we can use both these methods.
Read more »

How to add favicon in WordPress using Jetpack

In my earlier post Understanding favicon I explained what is a favicon, how to create and add it to your site. To add the favicon you have to create an icon and upload it to your server and then add some code to your site. However, if you have only WordPress site and you use Jetpack plugin, then you can easily add the favicon to your site using the new Site Icon module introduced in Jetpack 3.2
Read more »

How to enable HTTPS on WordPress using CloudFlare

Recently, Google said it will use HTTPS as a ranking signal. So, if you are a website owner, you might be thinking of switching to HTTPS. However, that meant purchasing an SSL certificate. Last month CloudFlare announced Universal SSL which will allow all its customers (including free users) to be able to use SSL on their sites. So now, we can have SSL on our websites without having to pay for an SSL certificate. In this article we will see how we can use CloudFlare to enable HTTPS on WordPress for free. This article assumes you are already using ClodFlare on your website.
Read more »

Protocol relative URLs

Many times we have seen warnings similar to “This page contains both secure and nonsecure items” or “This page has insecure content.”. This happens when we are viewing a HTTPS site and some content on the site is loaded from HTTP. So when we try to view a site say https://www.example.com and we get this warning, that means some content on the site is getting loaded from a non https site, like http://www.example.com. These warning messages can be fixed by using protocol relative URLs.
Read more »