PHP Programing language

adplus-dvertising
How can using index in square bracket to create a new element and or assign value
Previous Home Next
<html>
<head>
<title>Use the index in square brackets to create new elements 
and or assignvalues</title>
</head>
<body>
<?php
$a=array('harsh',123,'aditya');
$a[1]='onetwothree';
$a[4]='mukund';
echo($a[0]),"<br>";
echo($a[1]),"<br>";
echo($a[2]),"<br>";
echo($a[4]),"<br>";
?>
</body>
</html>

Output:

Previous Home Next