Home arrow PHP arrow Page 3 - PHP: The Switch Statement and Arrays

Printing the Array Values - PHP

In our last exciting adventure (back in early November), we braved crocodiles, ravenous editors, most of the PHP statements, and beginning loops. In this edition we'll cover the final statement, the Switch, and discuss arrays. So sit back, order your R2D2 robot to bring you a cold, frosty Jolt Cola, and let's get cracking.

TABLE OF CONTENTS:
  1. PHP: The Switch Statement and Arrays
  2. The Variable's Big Brother
  3. Printing the Array Values
  4. Associative Arrays
  5. The Multidimensional Array
  6. Beyond Multidimensional Arrays
By: James Payne
Rating: starstarstarstarstar / 6
January 07, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

If we wanted to print the values inside of the array, we could do so this way:


<html>

<body>

<?php

$mygirlfriends[0] = “Your Mother”;

$mygirlfriends[1] = “Angelina Jolie”;

$mygirlfriends[2] = “Whitney White”;


echo $mygirlfriends[1] . “and” . $names[2]



}

?>

The above code would print:

  Angelina Jolie and Whitney White



 
 
>>> More PHP Articles          >>> More By James Payne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: