Contact Us || Privacy Policy || About Us |
|
Array in PHP1) An array is a special variable, which can hold more than one value at a time. 2) An array is used to store multiple values, in a single variable. ![]() Types of Arrays in PHPThere are three types of arrays . These are:
1) Indexed Arrays in PHPPHP index starts from 0. You can store number, string and object in PHP array. Two examples shows in creating way an indexed array. Example 1 :-Output Array ( [0] => PHP [1] => Java [2] => .Net ) Example 2 :-Output Season are: PHP, HTML, CSS and JS 2) Associative Arrays in PHPAssociative Arrays using this type of symbol => Example 1 :-Output Peter salary: 350000 John salary: 450000 Kartik salary: 200000 Example 2:-Output Peter salary: 350000 John salary: 450000 Kartik salary: 200000 3) Multidimensional Arrays in PHPA multidimensional array store date in tabular form and which is represented in matrix form row * column. Example 1 :-Output Volvo: In stock: 22, sold: 18. BMW: In stock: 15, sold: 13. Saab: In stock: 5, sold: 2. Land Rover: In stock: 17, sold: 15. Example 2 :-Output ![]() |