for ($i=0; $i<=$#parts; $i++) { print "Element $i: $parts[$i]\n"; }