Q. What will be the output of the following PHP code?

Code:
$cars = array("Datsun", "Jeep", "Lada", "Spyker");
$car = preg_grep("/^L/", $cars);
print_r($car);
?>
  • (A) Array ( [2] => Lada )
  • (B) Array ( [1] => Jeep )
  • (C) Array ( [0] => Datsun )
  • (D) Array ( [3] => Spyker )
πŸ’¬ Discuss
βœ… Correct Answer: (A) Array ( [2] => Lada )

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
57163
Total Visits
πŸ“½οΈ
5 y ago
Published
πŸŽ–οΈ
Ruchi Sharma
Publisher
πŸ“ˆ
97%
Success Rate