Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in /home/joshual/public_html/wp-includes/plugin.php on line 571

Warning: Parameter 1 to wp_default_styles() expected to be a reference, value given in /home/joshual/public_html/wp-includes/plugin.php on line 571

Warning: Cannot modify header information - headers already sent by (output started at /home/joshual/public_html/wp-includes/plugin.php:571) in /home/joshual/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 60

Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in /home/joshual/public_html/wp-includes/plugin.php on line 571
PHP: “Increment” alphabet characters | Joshua Lückers

PHP: “Increment” alphabet characters

Today I discovered that it is possible to “increment” alphabet characters in PHP.

$letter = "a";
$letter++;
echo($letter);

This will result in b. The same applies to capitals.
Note that character variables can be incremented but not decremented!

Now you wonder what happens if you reach the last letter in the alphabet:

$letter = "z";
$letter++;
echo($letter);

This will result in aa. The same applies to capitals.

Did you know this was possible with PHP?

Laat een reactie achter bij Dan Reactie annuleren