I'm working through SAMS learn PHP in 24 hours. One bit has me stumped, & it has to do with a bit of code they have in the Chapter on Objects that uses array_push with an associative array.
I can't picture what's going on =(
Here's the code, which I've taken from an object def'n:
function addRowAssocArray ($row_assoc)
{
$row = array ( );
foreach ( $ this->headers as $header)//header was defined in the class as an array variable
{
if (! isset ($row_assoc[$header] ) )
$row_assoc[$header] = " ";
the following is what I don't get
$row[ ] = $row_assoc[$header]; // Can't figure out what this looks like using #'s
}
array_push($this->table_array, $row);
return true;
}
If anyone could shed a bit of light, I'd much appreciate it.
Rita