Tag: PHP

What can I do with PHP programming language

PHP is a server-side scripting language, and as such, it can be used to perform a wide range of tasks on the server side of a web application. Here are some common things that can be done in PHP: These are just some of the things that can be...

Most popular programming languages

Based on the TIOBE Index, following are the most popular programming languages: These statistics are subject to change over time and may differ depending on the source and methodology used to measure popularity....

How to convert XML to JSON using PHP code

This post show how to convert XML to JSON using PHP code. json_encode() function converts valid XML to JSON Following is example: In this example, we have an empty data.json file and a data.xml with the following content data.xml <staff> <employee> <name id="1">Alice</name> <dob>January 1, 2000</dob> </employee> <employee> <name...

How to create CSV output from PHP code

This post shows how to generate CSV output from PHP code. In PHP, the fputcsv() function generates a csv file when it is provided a valid two dimensional array. Following is an example with explanation // create a two dimensional array of data $myarrays = array( array ('Canada', 'China'),...

PHP: How to fix problems with European character encoding

Recently, I had to build a multilingual portal. Soon I ran into character encoding problems. Gibberish would appear in place of special characters such as umlaut, accent circonflex, etc. Naturally, I checked out PHP manual, MySQL manual, blogs etc. The solution is easy but the problem needs to be...