Arrays In PHP

This Tutorial Has Been Viewed 516 Times.

There are two types of arrays we deal with in PHP.

  • Numeric Arrays
  • <?php $employee_names[0] = "Raj";
     $employee_names[1] = "Thomas"; 
    $employee_names[2] = "Anil";
      echo "The first employee's name is ".$employee_names[0]; 
    echo "<br>"; 
    echo "The second employee's name is ".$employee_names[1]; 
    echo "<br>"; echo "The third employee's name is ".$employee_names[2]; ?>

 Associative Array

<?php	 $employee_names = array("arun" => "Owner", "balu" => "Manager", "Thomas" => "Peon");
echo "Matt is the ".$employee_names["balu"]; ?>

 

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Incoming search terms:





You will also be interested in ,

Tags: ,

One Response

  1. zkhkctcmk says:

    Very simple array tutorial

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

Leave a Reply

Spam protection by WP Captcha-Free

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks
More in PHP (98 of 122 articles)