Going Through Arrays

Here we are iterating over the values of an array.

\n"; $ct = 0; foreach(array("This", "is", "the", "way", "to", "do", "it.") as $word) { echo "$word "; ++$ct; } echo " ($ct words)

\n"; echo "

Here are all the _SERVER variables sent to the ", "script:

"; foreach ($_SERVER as $key => $val) { echo "\n"; } echo "
$key", htmlspecialchars($val), "
"; ?>