Reply with a PHP function Forum Game

Ghost

Seasoned Veteran
Blogger
Jun 25, 2009
3,202
187
213
Earth
wubur.com
FP$
2,497
So the way this works is simple. You must reply with a PHP function that modifies the function above it. You also must say what you think the function above your reply actually does. The PHP code must flow together so that we can always figure out what the starting values became by the end of this thread. If the user above you writes code that returns an array, your code must use the array.

Here is an example:
PHP:
function ghost($int){
return "$int ghost is here";
}
$DONOTCHANGE = 1; 
$DONOTCHANGE = ghost($start);
Here you can see that my code block takes the starting number and makes a sentence. It returns this string from my function. The starting number in the example above is not part of this game. See below.

User #2 in this thread could then write this, following this games rules.
Answer :
"Ghost's code says how many ghosts there are." (Correct)

Then include your code:
PHP:
function user2username($whatever){
return strlen($whatever);
}
$DONOTCHANGE = user2username($DONOTCHANGE);
In user 2's code it returns the number of characters in this string. User 3 would say this to be correct and then create a function to build off that. Do not change the $DONOTCHANGE variable. That way I can put it all together and see what comes out on the page.

------
Here is the starting value.
Whoever kicks this off should use the $DONOTCHANGE variable with their function just like the examples above!!

$DONOTCHANGE = "Hello";
 

Ghost

Seasoned Veteran
Blogger
Jun 25, 2009
3,202
187
213
Earth
wubur.com
FP$
2,497
Okay, I'll just start it off!

PHP:
function ghost($var){
return $var . " World";
}

$DONOTCHANGE = ghost($DONOTCHANGE);
~~
The next user must accurately describe what my function will return & then do something unique with that value.
 
Last edited:
HELLO