This option will reset the home page of this site. Restoring any closed widgets or categories.

Reset

Arrays In PHP

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.5.7_846]
Rating: 0.0/10 (0 votes cast)
VN:F [1.5.7_846]
Rating: 0 (from 0 votes)

Related posts:

  1. C# VS Java

1 Comment

  1. zkhkctcmk says:

    Very simple array tutorial

    VA:F [1.5.7_846]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.5.7_846]
    Rating: 0 (from 0 votes)

Leave a Reply

Comments (required)

Spam Protected