PHP: Quickly Generate An Array From Variables With The compact() Function

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.

Read morePHP: Quickly Generate An Array From Variables With The compact() Function

PHP: How Can I Find Out, Whether A Number Is Odd Or Even With The Modulo Operator?

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:

Read morePHP: How Can I Find Out, Whether A Number Is Odd Or Even With The Modulo Operator?

3 Great HTML5 Attributes That Simplify Coding

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.

placeholder-Attribute

Do you know this placeholder texts within form fields like e.g. “Enter your email adress here”? Well with HTML5 you can add placeholders quite easily to your form fields. Just add the placeholder attribute to your form tag. No Javascript or other hacks needed anymore.

Read more3 Great HTML5 Attributes That Simplify Coding

How To Convert A Decimal Number To A Binary Number

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:

Read moreHow To Convert A Decimal Number To A Binary Number

Work More Efficiently With The WordPress Visual Editor By Using Shortcuts

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.

Read moreWork More Efficiently With The WordPress Visual Editor By Using Shortcuts

How To Manually Deactivate A WordPress Plugin

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

PHP: Detect Time Of Last Modification Of A File

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:

Read morePHP: Detect Time Of Last Modification Of A File

Display A HTML-List Horizontally

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:

Read moreDisplay A HTML-List Horizontally