All pastes #427861 Raw Edit

Something

public text v1 · immutable
·published 2007-04-07 01:55 UTC
rendered paste body
<?php

$arr=array('a','b','c');

for ($i=1; $i<=3; $i++) {
 val=$arr[$i];
 echo $val;
 }

# the above works.  It will output abc.
# however, the following will not work.  It will only output c.  Do you see why?

for ($i=1; $i<=3; $i++) {
 val=$arr[$i];
 }

echo $val;