Daily Archives Thursday, March 2007

PHP: Swap Variables One Liner

Here's a nifty one liner in PHP which let's you swap 2 variables values.
PLAIN TEXT
PHP:

list($a,$b) = array($b,$a);

Much like the PHP XOR swap there's no real reason this is any better than using a temporary variable, but you might be able to impress chicks with it or something.
/* Pete Graham */

Drupal: Hide Navigation on Forum

If you want to hide certain Navigational Blocks on your Drupal sites forum(s) here’s how to do it:
1. Go to "Administer » Blocks"
2. Click "configure" on the block you want to hide.
3. On Page specific Visibility Settings click the option for "Show if the following PHP code returns TRUE"
4. Enter the following code in the [...]