Is there any way to create a dynamic array path?
I have tried to do it with a variable, but it doesnt seem to work:
e.g.
class ArrayPath
{
function ArrayPath()
{
$Test[Address][Line1] = '2067 Hampton St';
$Path = 'Test[Address][Line1]';
echo $this->$Path;
} // end of function
} // end of class
$Object = new ArrayPath;
prints nothing.
However I am using exactly the same technique to do dynamic function calls.
e.g.
class DynamicFunction
{
function DynamicFunction()
{
$Field_Type = 'Phone';
$Validation_Call = 'Validate_' . $Field_Type;
$this->$Validation_Call();
} // end of function
function Validate_Phone()
{
echo 'success';
} // end of function
} // end of class
$Object = new DynamicFunction;
prints 'success';
I am using PHP 4.3.1.
Thanks in advance.