Dear All,
I would expect the following to produce the integers 0 to 10 & their respective squares. However it produces a blank screen. Any idea why ? thanks
Kaps
P.S I did try and use the code tags (and previewed the code before submission) but no joy. Does anybody know why ?
[code = php]
<?php
for($i=0;$i++;$i<10)
{
$squared[$i] = $i*$i;
printf("%d %d",$i,$squared[$i]);
}
print_r ($squared);
?>
simple array query
Moderator: General Moderators
Re: simple array query
Code: Select all
for($i=0;$i++;$i<10)No whitespace around the =s.Kaps wrote:P.S I did try and use the code tags (and previewed the code before submission) but no joy. Does anybody know why ?
Re: simple array query
Thanks. Much appreciated.
Kaps
Kaps