Posted by Paul F. Johnson on 05/21/06 16:54
Bent Stigsen wrote:
> Paul wrote:
>> I know the substr stuff works (I can test that and it's fine and dandy).
>> I know the $month et al works as well (I've cut and pasted it from a
>> website I run at work). However, I'm not at all sure that how I'm using
>> the empty arrays (especially the multi-dimension array) is correct.
>
> Use of array_push looks fine.
> You could use syntax like $event['Event'][] = $line[3], but the result
> would be the same.
Thanks :-)
My main problem though is how to get data out of the array.
For example
echo $event['Event'][$i] . "<br />";
doesn't give anything - even if I have explicity put something into the
array (for example
$event['Event'][0] = "wibble";
$event['Event'][1] = "wobble";
$event['Event'][2] = "fibble";
$event['Event'][3] = "fobble";
for ($i = 0; $i < 4; ++$i)
echo $event['Event'][$i] . " ... " . $i . "<br />";
displays nothing other than " ... 0-3")
Is this more likely to be me or the version of php I'm using?
TTFN
Paul
[Back to original message]
|