Archive for the ‘Uncategorized’ Category
Prince Forlan Charming
PHP Variable variables
A seldom used, but incredibly useful, aspect of PHP is the ability to reference variables by name, based on the contents of a variable. Don’t worry if that sentence didn’t make sense to you. Let’s see an example:
$a = "hello"; // $a is "hello"
$$a = "world"; // Now $hello = "world"
echo "$a ${$a}" // outputs "hello world"
echo "$a $hello" // also ouptuts "hello world"
This is useful in the situation that you need to access an object class variable at runtime. Let’s say we have three class variables:
$this->cycle_1_mark
$this->cycle_2_mark
$this->cycle_3_mark
At runtime, we have a variable $semester which holds the current semester. To it access it, we do something like:
$myObject = new Object();
echo $myObject->{"cycle_$semester_mark"}; // outputs the value for the substituted class variable
More on PHP.net:Variable Variables.
The best summer ever!

This summer has got to be the very best ever! Here are links to some of my photos. Enjoy!
Stephen Fry on GNU
Congratulations Barack Obama!

Congratulations Barack Obama!
President-elect, Barack Obama’s acceptance speech
Joe the Plumber and McCain’s daughter
What did Joe the Plumber just say to Meghan McCain?

Please vote for Obama posted to 12seconds.tv
Things I want to play with after exams
- Firebird Database
- OpenAFS (Andrew FileSystem)
- eJabberd
- Ruby
- Mechanize
- Rsync and RSnapshot
- MySQL Replication
Windows 7
For the first time in years I think I may be excited about Windows (in particular Windows 7). Until I get some time to do my own review of the M3 pre-beta, here are links to some of my favourite links.










