Q. What will be the output of the following PHP program?
Code:<?php
$fruits = array ("apple", "orange", array ("pear", "mango"),"banana");
echo (count($fruits, 1));
?>
Dear candidates you will find MCQ questions of PHP here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"),"banana");
echo (count($fruits, 1));
?>
<?php
function multi($num)
{
if ($num == 3)
echo "I Wonder";
if ($num == 7)
echo "Which One";
if ($num == 8)
echo "Is The";
if ($num == 19)
echo "Correct Answer";
}
$can = stripos("I love php, I love php too!","PHP");
multi($can);
?>
<?php
class Example
{
public $name;
function Sample()
{
echo "Learn PHP";
}
}
?>
<?php
define("GREETING", "PHP is a scripting language");
echo $GREETING;
?>
<?php print "echo hello world"; ?>
<?php $one = 1; print($one); print $one; ?>
<?php
$cars = array("Volvo", "BMW", "Toyota");
print $cars[2];
?>
<?php $one = "one"; $two = "two"; print($one$two); ?>
<?php $one = "one"; $two = "two"; print($one,$two); ?>