An array stores multiple values in one single variable:
<?php
$fruits = array("apple", "banana", "orange");
echo "I like " . $fruits[0] . ", " . $fruits[1] . " and " . $fruits[2] . ".";
?>
<?php
$fruits = array("apple", "banana", "orange");
foreach($fruits as $value) {
echo $value;
}
?>
Learn PHP If-else Conditions: We have the following conditional statements in PHP language
Learn PHP loops: For loops execute the code number of times.
PHP Form Submission: For post data superglobals $_GET and $_POST are used in php.
Learn PHP array: An array stores multiple values in one single variable