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.
In HTML5 data- Attributes were introduced. They are a big improvement, because they allow you to store information within a HTML tag. They look like this:
<div id="abc" data-listsize="20"></div>
The include statement is a simple way to include PHP code from another file.
The usage is quite simple. Just write something like this:
<?php include 'a_file.php';
If the file is successfully included it will return a TRUE or 1. If it failes to include the file it will return a FALSE. But sometimes you may need to get the content of an included file in order to store it in an variable. Unfortunately the include statement just returns TRUE or FALSE, as mentioned above.
Would you like to use an arrays key as a normal variable in PHP? Well, the extract() function is a great way to generate variables from an associative arrays keys. In this article I’ll show you how.
<script> var allItems = ['A', 'B', 'C', 1, 2, 3, 4, 5]; </script>
Do you want to find out the modification time of a file in your PHP script? Well, in this article you’ll find out how easy this is. 😉
Do you want to build an array in PHP, which should contain existing variables? Well, there is an easy way to do this. PHP has a very cool function for this to do. You can use the variable’s name as the key and the variables value as the value.
HTML5 offers a lot of new features, which were, in my opinion, long overdue. In this article i will show you three great new HTML5 attributes which will make coding your HTML5 Website easier.
Converting a decimal number to a binary number is easy. You just have to divide the decimal number by 2. If the division yields an integer, note 0, otherwise 1.
Now take the integer part of the division and divide it again by 2. Here, too, the value 0 or 1 is determined analogously.
This is done until the result of the division is 0.
Here is an example:
It is very easy to count DOM-Elements within a HTML-file by using jquery. Here is a little example: