Referencing?
Posted: Sat Oct 05, 2002 5:07 pm
Okay here is my problem:
I have an array that needs to reference a variable that does not exist YET, but when the array is called from a function, i want it to be in use...
so something like:
i want it to print out
Some textHERE WE Go.. Some more text
im doing this in OOP, and it's giving me a parse error, but i thought that was the only way i could reference it?
if you need the exact code to be posted i can do that but that was the main idea
(ps, its XML handling of attributes)
I have an array that needs to reference a variable that does not exist YET, but when the array is called from a function, i want it to be in use...
so something like:
Code: Select all
<?
$array = array(
"foo" => "Foo",
"bar" => "Some text" . &$bar . " Some more text"
);
$bar = "HERE WE Go.."
function thing($bar){
global $array;
echo $arrayї'bar'];
}
?>Some textHERE WE Go.. Some more text
im doing this in OOP, and it's giving me a parse error, but i thought that was the only way i could reference it?
if you need the exact code to be posted i can do that but that was the main idea
(ps, its XML handling of attributes)