Archive for the ‘Geeky Funny’ Category

Shorthand PHP if else Statements

Friday, January 23rd, 2009

Am playing with some OOP PHP again and have found a nifty way to cut down short if else statement

return ($count == 1 ? 'Incorrect password' : 'Incorrect username.');

is the same as

if ($count == 1 ) {
return 'Incorrect password';
} else {
return 'Incorrect username.';
}

Bargain!

Shane

Scouse as a Meta Lang Declaration

Thursday, October 23rd, 2008

Have just randomly found out that you can put your meta language as scouse on HTML.

Using the following
lang="en-GB-scouse"

Will actually validate according to the W3c lang Test Spec. WHYY!!!!

Made me giggle thought I’d share.

Shane