Results 1 to 5 of 5

Thread: PHP Arrays

  1. #1

    PHP Arrays

    I looked at the manual on the php site about it but didn't quite understand what it meant. If some one clould explain it a bit clearer for me as to how to set value in an array and such. Thanks
    LipWeb.Net
    "Less Lip More Service"
    Providing Quality Hosting at Fair Prices
    AIM: LipWebNet MSN: daniel[at]lipweb.net [color=red]

  2. #2
    Edit: Missed the last part --

    PHP Code:
    <?php
     $name
    [] = "Bob";
     
    $name[] = "John";
    ?>

    or you could also set it this way

    <?php
     $name 
    = array ("Bob","John");
    ?>
    An array is nothing more than another way to store and display data.

  3. #3
    now in access it for example if I wanted to compare the value in the array to another value. for example in psuedo code.

    Code:
    <?php
        $name[]  
        //declaring $name for future use, not sure if possible in php
        if (data == $name[])  //data represents another value
        {
             //do something
        }
        else
        {
            //do something else
        }
    LipWeb.Net
    "Less Lip More Service"
    Providing Quality Hosting at Fair Prices
    AIM: LipWebNet MSN: daniel[at]lipweb.net [color=red]

  4. #4
    Join Date
    Sep 2001
    Location
    Manila
    Posts
    71
    $A[0]="hello";
    $A[1]="<br>";
    $A[2]="world";

    for($counter=0;$counter<3;$counter++)
    {
    echo "$A[$counter]";
    }

    that would give a result of:
    hello
    world

  5. #5
    thanks both of you, its very similar to java(if not the same) just wanted to make sure before I started screwing with a friends code to make something to work.
    LipWeb.Net
    "Less Lip More Service"
    Providing Quality Hosting at Fair Prices
    AIM: LipWebNet MSN: daniel[at]lipweb.net [color=red]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •