hi,
When creating a variable in a function, you must make it a GLOBAL variable first because all variables in a function are destroyed once the function ends.
What will you be using this for? I am sort of confused becuase why would you need to create a function for appending to a variable?
What would be better would be for you to put the variable in the parenthesis of the function (this is confusing) ie:
$var = "hello";
function add_to_var ($var) {
$var_add = " World!";
$var_return = $var.$var_add;
return $var_return;
}
So, to call this function, you would use this method:
$var1 = add_to_var( $var );
or
print add_to_var( $var );
This, I think, would be a better method.
If you need more clarification, or I was doing something wrong, just email mee at brad_at_getcoded_.net (replace at for the @ and get rid of underscores. I just dont want spammers to be overflowing my email box.)
Hope that this helps!
Brad Taylor
Senior Web Producer
BradCom Industries LTD