Subject: PHP

Check if Array is Sorted

Write a PHP function that checks if a given array is sorted in ascending order.

Example:
Input: [1, 2, 3, 4, 5]
Output: true

Input: [5, 3, 4, 1, 2]
Output: false

Select file or drag and drop

PNG, JPG, SVG

Preview