View Single Post
06-04-2012, 11:04 PM
#4
.Nick is offline .Nick
.Nick's Avatar
Status: Yawn
Join date: Feb 2005
Location:
Expertise: Drupal
Software: Chromium, Komodo Edit, Eclipse
 
Posts: 1,159
iTrader: 3 / 100%
 

.Nick is on a distinguished road

  Old

Originally Posted by Dan View Post
It's just a bunch of if statements.

Run them through your head with: ($user = "username") || ($user = null)

I cannot create variables that can be used outside of the function from the function? Like:

function username($user) {
if($user = null)
$deleted = "deleted";
}

Then when the function is called username($username); I can echo $deleted? Is something like this at all possible? My tests show the above wouldn't work.
http://php.net/manual/en/language.variables.scope.php

You could declare $deleted outside the function and then get access to it inside a function with the global keyword.

Not that I'm saying that's a good idea or anything.