Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // unordered list
- $arr = array(1, 2, 3, 3.14, 5, 4, 6, 9, 8);
- // searched value
- $x = 3.14;
- $index = count($arr);
- while ($arr[$index--] != $x);
- echo "The value $x found on position " . ($index+1) . "!";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement