PHP SOP3.php
<?php
$subjects= array('Physics' => '80', 'I.T.' => '75', 'Maths' => '78', 'Chemistry' => '90');
//display elements in an array key value pairs
echo"<br>Elements in the Subjects(Key) array with marks(value)";
echo"<br> Marks Scored in Physics is".$subjects['Physics'];
echo"<br> Marks Scored in Biology is".$subjects['I.T.'];
echo"<br> Marks Scored in Maths is".$subjects['Maths'];
echo"<br> Marks Scored in Chemistry is".$subjects['Chemistry'];
// to display size of array
echo"<br> Size of the Array is:".count($subjects);
//delete element from this array
array_splice($subjects,2,1);
echo"<br>After Deleting Elements of array is:";
foreach ($subjects as $s=> $s_value)
{
echo "<br> Key=".s, "Value=".$s_value;
}
?>
INFORMATION :- SAVE AS PHP FILE.
Tags :-
12th I.T SOP solution,
12th I.T SOP,
12th I.T chapter 3 SOP solution,
12th I.T PHP SOP 3,
12th I.T SOP 3 PHP,
12th I.T SOP 3
0 Comments