PHP Tutorial
What is PHP Environment Setup of PHP PHP Syntax PHP Comments PHP Echo & print PHP Variables PHP Scope Variables PHP $ and $$ Variable PHP Constants PHP Operators PHP Data TypesPHP Conditional Statements
PHP Loop Type
PHP Arrays
PHP String PHP FunctionsPHP Form Examples
Form Intro Get & Post Form Validation / Required PHP Complete FormPHP Advanced
PHP Include / Require PHP Date & Time PHP Session PHP Cookies PHP File Handling PHP Open File PHP Read File PHP Write File PHP Append File PHP Delete File PHP File Upload PHP Sending Mail PHP Error HandlingWhat is an Array
An array stores multiple values in one single variable:
Example:
$fruits = array("Apple", "Orange", "Banana");
What is PHP Arrays?
Arrays are complex variables that allow us to store more than one value or a group of values under a single variable name. Let's suppose you want to store fruits in your PHP script. Storing the fruits one by one in a variable could look something like this:
<?php
$fruit1 = "Apple";
$fruit2 = "Orange";
$fruit3 = "Banana";
?>
In PHP, the array()
function is used to create an array:
array();
In PHP, there are three types of arrays:
- Indexed or Numeric Arrays: An array with a numeric index where values are stored linearly.
- Associative Arrays: An array with a string index where instead of linear storage, each value can be assigned a specific key.
- Multidimensional Arrays: An array which contains single or multiple array within it and can be accessed via multiple indices.
SEARCH POST HERE
Support Us
Subscribe My YouTube Channel
Join Our Telegram Channel & Support Eachother
CATEGORIES
INTERVIEW QUESTIONS
POPULAR POSTS
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Read More
Newsletter
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date