Thursday, June 16, 2011

Tutorial 2: Arrays

An associative array, each ID key is associated with a value. These ID keys can be used as a value in your script. For example,
<?php
$ages['Peter'] = "32";
$ages['Quagmire'] = "30";
$ages['Joe'] = "34";

echo "Peter is " . $ages['Peter'] . " years old.";
?>

This uses the array to show how old peter is. If you have any further questions on arrays feel free to click here

7 comments:

  1. Thanks man, will try it out later :)

    ReplyDelete
  2. This is useful when reporting on data that was entered by a user. I have a PHP/MySQL book laying around somewhere that I haven't opened yet. :/

    ReplyDelete
  3. i can sort of make sense of it , but its giberish to my c++ mind..

    ReplyDelete
  4. I see what you did there, although i had to look at it for a few minutes...

    ReplyDelete
  5. Nice tutorial. I love PHP syntax. Also, giggity.

    ReplyDelete
  6. Nice tutorials, but I probably should start with something simpler... although the names help.

    ReplyDelete