you loop through the array and substitute the appropriate values where necessary. The variable $k holds the array key, and $v holds the array value. You also set $i to 1 because it will be incremented immediately inside the loop: echo
Article Availability
n ; $i = -1; foreach ($a_artTypes as $k => $v) { $i++; Here s your first use of the array key. The first pass through, this will read Pending Articles. Next time through, it will read Published Articles. Clever? echo
. $k . Articles
n ; Notice that you are using $v in what follows to create the field date_submitted in the first loop, and date_published in the second. You are also using $i to first compare is_published to 0, and then to 1 in the next loop. echo
n ; echo
n ; echo
n ; } require_once footer.php ; ?> 467 Building a Content Management System
In case you need quality webspace to host and run your web applications, try our personal web hosting services.