How to get client IP Address with PHP

Before we go any further, never trust data sent from the client. The most reliable value in PHP you can hope is $_SERVER[‘REMOTE_ADDR’] that contains the real IP address of the connecting party. But the client can be hidden behind a proxy server. The proxy...
How to Easily Parse XML with PHP

How to Easily Parse XML with PHP

As a web developer, Parsing XML is a common task that we have to deal with it. RSS (Real Simple Syndication) and XML-RPC are many technologies that are fundamental in a web development of CMS. Fortunately, PHP5 offers a simple but powerful tool called simpleXML. It...
How to convert string to date format in PHP

How to convert string to date format in PHP

In PHP there is an easy way to convert a string to date format. And it will work in all situation flawlessly. Problem Let’s say that we have this date in string format that we want to change to date format in PHP: $olddate = '2008-07-01T22:35:17.02'; Basic and...