*Message Removed*
Edited by Agesilaus (Forum Moderator): Please do not be rude.
Printable View
*Message Removed*
Edited by Agesilaus (Forum Moderator): Please do not be rude.
not always, you could do:
and then doPHP Code:class hi
{
var $sitedomain;
var $site_name;
function replace($string)
{
whatever
}
}
although yours is easier.PHP Code:$function = new hi;
$function->sitedomain = $sitedomain;
$function->site_name = $site_name;
$function->replace("hi");
If you do not global outside variables into the function then the newly defined variables within the function will be returned as null.
Example:
The value of $site within the function would be blank / null.PHP Code:$site='32';
function something($string) {
$string = $site.$string;
}
I believe you need to global it on each function.