PHP Tutorials

How to Resize Image in PHP

How to Resize Image in PHP

Almost every website uses thumbnail or resized images with content in form of featured image. Every website showing thumbnails in product gallery, portfolio, featured section, etc. So I have created a function to resize image in php. With this you can resize images easily using PHP and the GD library. If you’re looking for the same to resize uploaded images you can try it. In this article I will show …

Continue reading

How to Validate RSS Feed in PHP

How to Validate RSS Feed in PHP

RSS is now greate source of announcing new content of a Web site. RSS feeds are in XML format, but these feeds need to build with RSS specifications, so they can be executed well when any programs and sites that syndicate the feeds. We can there are some online tools to validate RSS feed like feedvalidator.org, validator.w3.org/feed/, rssboard.org/rss-validator/ etc, these tools checks if feed compliant with different version of RSS …

Continue reading

How to Create QR Code with Google API and PHP

QR Code with Google API and PHP

QR code stands for Quick Response code. It is a two dimensional code designed to capture all the information using a Smart Phone. It is a type of matrix bar-code. They are also known as hardlinks or physical world hyperlinks. This code can be used to encode any information such as text, URL, Telephone numbers, Addresses and any other data. Here I will discuss how to create QR code with …

Continue reading

How to Send Email in PHP

How to Send Email in PHP

Email is the most popular Internet service nowadays. Every day plenty of mail are sent. In this article I am explaining how to send email in php. Every web application used the email feature as in signup response, monthly newsletter etc. Sometimes email contains a plain text, HTML body and file attachments. I will explain each with a simple example. Plain Text Email: PHP has mail() function to send an …

Continue reading

How to Read RSS Feeds using PHP

How to Read RSS Feeds using PHP

RSS feed is used to provide updates of blog or website for various platforms. We can use these feed to display as latest updates, news etc on our site. In this post I am explaining how to read rss feeds using php. Let’s our rss feed url is http://demos.tricksofit.com/files/rss.php Now we will read the content of the url using file_get_contents and store it in a variable called $content. file_get_contents — …

Continue reading

How to Create RSS Feed in PHP

How to Create RSS Feed in PHP

RSS stands for Really Simple Syndication. It’s an XML-based content format for distributing content, news etc. It makes your content global and available to various platforms. Most popular sites and blogs provide RSS feeds for you to subscribe. You need a feed reader to view its contents, that’s all. You can also create RSS feeds for your own website. In this post I am explaining how to create RSS feed …

Continue reading

Difference Between PDO And MySQLi

Difference Between PDO And MySQLi

We have two choices for accessing the database in PHP : MySQLi and PDO. We have already compared them with old mysql extension in Difference between mysql and pdo and Difference between MySQL and MySQLi. In this article, we will discuss difference between PDO and MySQLi on various feature like database support, stability and performance to find which is the better API. Connection : // PDO // mysqli, procedural style …

Continue reading

Get geolocation from ip in PHP

Get geolocation from ip address

In PHP, there is no direct way to get geolocation of an IP address. Therefore we have to use third party API to get geolocation from ip address. There are many paid and free APIs available to get geolocation from ip address. I found a very simple and easy api freegeoip.net. It is a public RESTful web service API for searching geolocation of IP addresses and host names. freegeoip.net API …

Continue reading