• HOME
  • QUIZ
  • CONTACT US
EXAMIANS
  • COMPUTER
  • CURRENT AFFAIRS
  • ENGINEERING
    • Chemical Engineering
    • Civil Engineering
    • Computer Engineering
    • Electrical Engineering
    • Mechanical Engineering
  • ENGLISH GRAMMAR
  • GK
  • GUJARATI MCQ

PHP Arrays

PHP Arrays
What will be the output of the following PHP code?
$number = array ("4", "hello", 2);
echo (array_sum ($number));

4hello2
4
6
2

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$a = array("A", "Cat", "Dog", "A", "Dog");
print_r(array_count_values($a));

Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )
Array ( [A] => 2 [Cat] => 1 [Dog] => 1)
Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$fruits = array ("apple", "mango", "peach", "pear", "orange");
$subset = array_splice ($fruits, 2);
print_r ($fruits);

Error
Array ( [0] => pear [1] => orange )
Array ( [0] => apple [1] => mango )
Array ( [0] => apple [1] => mango [2] => peach )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$fruits = array ("apple", "orange", array ("pear", "mango"), "banana");
echo (count($fruits, 1));

4
5
6
3

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will be the output of the following PHP code?
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
$c = array_combine($age, $fname);
print_r($c);

Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
Array ( Peter Ben Joe )
Array ( 35 37 43 )
Array ( [35] => Peter [37] => Ben [43] => Joe )

ANSWER DOWNLOAD EXAMIANS APP

PHP Arrays
What will the following script output?
$array = array (1, 2, 3, 5, 8, 13, 21, 34, 55);
$sum = 0;
for ($i = 0; $i < 5; $i++) {
$sum += $array[$array[$i]];
}
echo $sum;

19
78
5
NULL

ANSWER DOWNLOAD EXAMIANS APP
MORE MCQ ON PHP Arrays

DOWNLOAD APP

  • APPLE
    from app store
  • ANDROID
    from play store

SEARCH

LOGIN HERE


  • GOOGLE

FIND US

  • 1.70K
    FOLLOW US
  • EXAMIANSSTUDY FOR YOUR DREAMS.
  • SUPPORT :SUPPORT EMAIL ACCOUNT : examians@yahoo.com

OTHER WEBSITES

  • GUJARATI MCQ
  • ACCOUNTIANS

QUICK LINKS

  • HOME
  • QUIZ
  • PRIVACY POLICY
  • DISCLAIMER
  • TERMS & CONDITIONS
  • CONTACT US
↑