Dear Newsgroupers,
The 'main' page contains a call to a function in an included file. This
function puts a html-form on the screen. Before the form gets posted (to the
'main' page) some prior errorchecking is done. The form fields are then sent
and an object is created (all in the same function).
What I need ( imo ) is an array with objects that can be written later to a
dbfile to preserve.
But I cannot find a solution for the extension of the array.
the function statements are simply these:
< inside function in included file >
$o = someObject( $s ) ;
$objarr[] = $o;
</ inside function in included file >
As this array is within a function it is local to this function.
As I understand it now a good solution would be to pass the array to the
function.
In the 'main' page I made a variable $objarr that is passed into the
function like this:
<'main' page>
$objarr ;
function( $objarr )
</'main' page>
The PHP manual states that in the absence of the array variable it gets
created. {Does this mean that function( $objarr ) would suffice? }
However,
whatever I try, I end up with the creation of $objarr[ 0 ] only.
Please advise
TIA,
pablo
The 'main' page contains a call to a function in an included file. This
function puts a html-form on the screen. Before the form gets posted (to the
'main' page) some prior errorchecking is done. The form fields are then sent
and an object is created (all in the same function).
What I need ( imo ) is an array with objects that can be written later to a
dbfile to preserve.
But I cannot find a solution for the extension of the array.
the function statements are simply these:
< inside function in included file >
$o = someObject( $s ) ;
$objarr[] = $o;
</ inside function in included file >
As this array is within a function it is local to this function.
As I understand it now a good solution would be to pass the array to the
function.
In the 'main' page I made a variable $objarr that is passed into the
function like this:
<'main' page>
$objarr ;
function( $objarr )
</'main' page>
The PHP manual states that in the absence of the array variable it gets
created. {Does this mean that function( $objarr ) would suffice? }
However,
whatever I try, I end up with the creation of $objarr[ 0 ] only.
Please advise
TIA,
pablo
Comment