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.
There is a simple way in PHP to find out, wheather a number is odd or even. All you need is the modulo operator.
What is the modulo operator?
The modulo operator in PHP is represented by an %. With this operator you can determine the rest of an interger division.
Here’s an example:
Would you like to display playing cards symbols like Diamonds, Hearts, Clubs and Spades on your HTML pages? Well, it’s quite simple. Just use the following HTML codes: Symbol Code HTML Diamonds ♦ ♦ ♦ Hearts ♥ ♥ ♥ Clubs ♣ ♣ ♣ Spades ♠ ♠ ♠ With the playing cards HTML codes you … Read moreHTML Codes For Playing Cards
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:
A while ago WordPress introduced in Version 4.3 a new feature for the visual text editor. So now it’s possible to use some Markdown-like (similar to Markdown) shortcuts.
If you write an article in the visual editor of WordPress, you can now format your text by typing in shortcuts.
It is very easy to count DOM-Elements within a HTML-file by using jquery. Here is a little example:
A while ago I installed a WordPress Plugin, which I was using with another installation before. After activating the plugin nothing in my WordPress seemed to work the way it had been working before. Or in other words: all I saw was a white browser-screen 🙁 “So, keep calm…”, I thought to myself. Then I … Read moreHow To Manually Deactivate A WordPress Plugin
Do you need to find out in PHP, when a file was modified? Then you should take a look at the PHP-function filemtime. This function expects a filename as parameter and returns the modification-time of this file.
Here is an example:
< ?php echo filemtime('anyfile.html'); ?>
This PHP-script will output the timestamp of the last modification of the file anyfile.html.
You can also format this by using the date-function:
Normally a HTML-list is displayed vertically, which means that each entry is below the previous entry. But for some reasons you might want to display the list vertically, e.g. for a menubar.
Here is a simple way to do that.
For this example I’ll use the following list:
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
The result looks like this:
- Item 1
- Item 2
- Item 3
Now, we add some CSS: