PHP: Convert XML To JSON

XML is a great format for data exchange. But JSON is used more and more for data exchanging and configuration. In my opinion JSON is a great, because it is more lightweight than XML. More and more apis work with JSON today. Recently I had to convert XML To JSON. Nothing special, just a simple XML String. In this article I’ll show you how to do this with only a few lines of code.

Read more

The JSON Format Explained

The JSON format is a very popular format for exchanging data. It is very easy to use. Find out, how to use the JSON format. What is JSON? JSON stands for JavaScript Object Notation. The format is identical to the way, you would create objects in JavaScript. It is a great way to exchange data … Read more

PHP: Convert An Array To JSON

Sometimes, when programming in PHP, you’ll need to convert an array to JSON. This enables you e.g. to retrieve data serverside through PHP and pass it to the client, which then can process this data with javascript. There are different ways to do that, e.g. via AJAX.
In this article I’ll show you, how easy it is to convert a PHP array into a JSON String.

Read more