HTML
HTML
• <!-- -->
<body style="background-color:yellow">
Syntax
• array(key => value)
key
Optional. Specifies the key, of type
numeric or string. If not set, an integer key
is generated, starting at 0
value
Required. Specifies the value
Example
• <?php
$arr = array("foo" => "bar", 12 => true);
• $a=array(3,4)
echo $arr["foo"]; // bar
echo $arr[12]; // 1
?>
foreach
• This simply gives an easy way to iterate
over arrays. foreach works only on arrays,
and will issue an error when you try to use
it on a variable with a different data type or
an uninitialized variable
Syntax
• foreach (array_expression as $value)
statement foreach (array_expression as
$key => $value) statement
•http://localhost/html_for
m_submit.php?user=