?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
$arr = array ("picture1.JPG", "picture2.jpg", "Picture10.jpg", "picture20.jpg");
sort($arr);
print_r($arr);
?>
<?php
$arr = array ("picture1.JPG", "picture2.jpg", "Picture10.jpg", "picture20.jpg");
sort($arr);
print_r($arr);
?>
Answer & Solution
Correct Answer:
Option
C
While sorting each character is compared with the others and sorted using ascii values therefore we the sorted array to be like option c.
Join the Discussion
Login to post a comment or share your explanation.
Login