Category php

Working with JSON

A common use of JSON is to read data from a web server, and display the data in a web page. Objects in PHP can be converted into JSON by using the PHP function json_encode() in reverse you can use json_decode()…

Redirect Based On Referrer Or IP Address

Using PHP you can easily redirect your website visitors to a different page depending on where they come from. For example you may have 2 different web sites selling a product but only one customer care web site where people…

Top 5 Best PHP Frameworks of 2018

Talking about the PHP frameworks, they are developed to complement PHP. PHP frameworks complement PHP in many ways, some of which are: Provides pre-built modules Serves a platform for building robust & reusable components Enables faster development cycles Using libraries &…

Convert Array to XML and XML to Array in PHP

XML (Extensible Markup Language) is a markup language that encodes documents in a machine-readable and human-readable format. Generally, XML is used to store and transport data. You can use XML many ways in the web application. If you’re concerned about…

Building Dynamic Sitemap Using PHP

One day you might discover that some of your websites are not showing up in the search results. You might believe they have links to them somewhere on your website, but you do not know for sure. Unless the search…

Generate A Random Password With PHP

In this tutorial, you will find out how to generate random passwords with a handy PHP function. It’s always better to use a randomly generated password rather than your name, birthday, city, etc. Nowadays most registration forms require you to…

Get POST JSON

What is JSON JSON stands for JavaScript Object Notation. JSON is a standard lightweight data-interchange format which is quick and easy to parse and generate. JSON, like XML, is a text-based format that’s easy to write and easy to understand for both humans…

PHP form validation

Lets create a simple form with name, email, website, comment and gender fields, having name, email and gender field as an required field. In the following code we have added some variables: $nameErr, $emailErr, $genderErr, and $websiteErr. These error variables…