Showing posts with label ksort(). Show all posts
Showing posts with label ksort(). Show all posts

PHP : Sort an array by key in Ascending or Descending order

In this tutorial learn how to sort an array using key in ascending or descending order in PHP.

function sortbyKeys($array, $direction = 'ASC')
    {
        $direction = (strtolower($direction) === 'desc') ? SORT_DESC : SORT_ASC;
        if ($direction === SORT_ASC) {
            ksort($array);
        } else {
            krsort($array);
        }

        return $array;
    }
      

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...