<?php
echo date("Y/m/d") . "<br />";
echo date("Y.m.d") . "<br />";
echo date("Y:->m:->d")."<br>";
echo("hello") ."<br/>";
$app5=5;
echo($app5);
$baby="going";
echo("$baby i love to ");
//echo ($baby$app5);
if($app5==5)
echo "dance"."<br>";
echo strlen("dance");
echo strpos("dance","h");
switch($ab=1)
{
case 1:
echo 1;
case 2:
echo 2;
default :
echo "default";
}
$a = array(1,2,5,3,6);
for($i=0;$i<5;$i++)
echo $a[$i]."<br>";
$a = array(1=>"apple",2=>"boy",3=>"girl",4=>"koel",5=>"good");
for($i=1;$i<=5;$i++)
echo $a[$i]."<br>";
echo $a[2]."<br>";
echo $a['2']."<br>";
$a=array (
$0=array(40,60,20),
$1=array(278,102,173)
);
for($i=0;$i<2;$i++)
{ echo "<br>".$a[$i];
for($j=0;$j<3;$j++)
echo $a[$i][$j]." ";
}
?>
I have started learning PHP today and I was trying out some very basic commands.
I am getting an error in line 35.
How to use 2-d arrays in PHP?
Also give example of Associated 2-d array.
Any help will be appreciated.