Well this will do the trick althought I wouldnt do things this way:
function FunctionOne() {
global $color;
$color = 'red';
}
function FunctionTWO() {
global $color;
FunctionOne();
echo "The color is $color";
}
FunctionTwo();
I would do this in an obejct oriented manner:
Class Color {
var $color = 'red'; // set default color
function SetColor($col) {
$this->color = $col;
}
function GetColor() {
return $this->color;
}
}
$col = new Color();
$col->SetColor('blue');
echo 'The color is '.$col->GetColor();