All About PHP array

We know what is PHP variable. In a variable we can store information. But PHP variable has some problem such as in a variable we cannot store same types of information. Variable takes same types of information as a one information. But we need to store our information separately.  
For an example, we want to store different name in a variable and the code is 
<?php
$variable="Sharif","Rahim", "Zohn"; 
echo $variable;
?>
This code show "Sharif","Rahim", "Zohn" but we want to show only Rahim or Zohn. That is the problem. To solve this problem we introduce PHP array. Array store same type of information and we can retrieve information separately from an array variable. To understand array we write a PHP code here.
Suppose that we want to store some customers name in a variable. Take a look at the code 
<?php
$customers=array(“Sharif”,”Rahim”,”Karim”,”Shuvo”);
echo $array[1];
?> 

Comments

Popular posts from this blog

How to construct a B+ tree with example

How to show only month and year fields in android Date-picker?

Visitor Counter Script Using PHP