The sort function sorts an array in ascending order.

    
    $fruits = array("watermelon", "lemon", "orange", "banana", "apple");

    sort($fruits);

    print_r($fruits);
    // Array (
    // [0] => apple
    // [1] => banana
    // [2] => lemon
    // [3] => orange
    // [4] => watermelon
    // )