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

Getting Visitor IP Address in PHP

Get Visitor IP Address

Some times we need to get visitor’s ip address for validation, security, spam prevention etc. In php it’s easy to get visitor ip address. No Proxy detection If there is no proxy detection we can get the visitor ip address with a simplest way as follow: But If a user access the website via a proxy server $_SERVER[‘REMOTE_ADDR’] will return the ip address of proxy server not of the proxy …

Continue reading

How to Add Apple Touch Icon to Website

How to Add Apple Touch Icon to Website

Mobile browsing is rapidly growing. We all know the importance of providing a better experience for our mobile customers. To get mobile traffic you can take a simple step to learn how to add Apple Touch Icon to website. If you are not using Apple Icons, iOS grabs a compressed thumbnail of your website and use it as an icon. Adding apple touch icons to website is like adding favicons …

Continue reading

Difference between MySQL and MySQLi

difference between MySQL and MySQLi

As we know the mysql_* functions are deprecated in PHP 5.5. So you should not use mysql_* functions in your application. We have better alternative of MySql is MySQL Improved that is MySQLi. In this article I am listing the difference between MySql and MySqli. MySQLi: – The i stands for Improved. The MySQLi extension is designed to work with MySQL version 4.1.13 or newer. MySQLi introduced with PHP 5.0 …

Continue reading