Become a fan of Slashdot on Facebook


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).


Journal: PHP Tutorial - Variables

Journal by Jarlsberg
A variable is a means of storing a value, such as a text string or a number. In PHP you do not have to declare your variable, as it's automatically declared when you set it. Since you do not need to declare the variable, you do not have to specify what kind of data it contains either.
User Journal

Journal: How to write a RSS feed with PHP

Journal by Jarlsberg
If you have a web site or blog, it's important to spread the word, and what's better than a properly designed and updated RSS feed? Here's how to write a PHP script that fetches the last 10 items from a database source and writes it to a RSS-file.
User Journal

Journal: Getting started with PHP

Journal by Jarlsberg

Worth your while if you're interested in PHP development. First part in the novice series:

If you want to learn the basics of PHP, then you've come to the right place. The goal of this series is to teach you everything you need to know about PHP so that you can:

  • Create and design your own PHP project
  • Understand and customize PHP scripts found on the net
  • Become the ultimate PHP guru

Journal: Rewriting with Apache

Journal by Jarlsberg

At I've written short how to for configuring Apache with wildcard domains.

Setting up wildcard domains with Apache is easy peasy. Step one is configuring the A Record for your domain. Step two is configuring httpd.conf to accept wildcard via ServerAlias. Step three, and this is the tricky part, is setting up Apache's RewriteEngine syntax. At, you get the whole working setup.


Journal: A note on modulus

Journal by Jarlsberg

Using bitwise operators are faster than modulus operators, right? Apparently this is not the case with PHP.

At, I've taken a hard look at whether using a ternary operator is faster than using modulus. I entered into this thinking the answer was obvious, the bitwise operator would win, hands down. Turns out, it ain't so.

Running several loops in varying steps, the most intensive being a consecutive loop from 0 to 1000000 (million) showed that $i%2 was significantly faster than $i&1==0, being about 9% faster in most tests. The results and the script used to verify the results are available at

So, there you go folks, modulus wins.

It's not so hard to lift yourself by your bootstraps once you're off the ground. -- Daniel B. Luten