{"id":2073,"date":"2021-06-29T07:10:31","date_gmt":"2021-06-29T07:10:31","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=2073"},"modified":"2025-04-06T04:54:51","modified_gmt":"2025-04-06T04:54:51","slug":"php-array-sort","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-tutorial\/php-array-sort\/","title":{"rendered":"PHP Array Sort"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the PHP array <code>sort()<\/code> function to sort elements of an array in ascending order.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-php-array-sort-function'>Introduction to the PHP array sort() function <a href=\"#introduction-to-the-php-array-sort-function\" class=\"anchor\" id=\"introduction-to-the-php-array-sort-function\" title=\"Anchor for Introduction to the PHP array sort() function\">#<\/a><\/h2>\n\n\n\n<p>The <code>sort()<\/code> function sorts the elements of an <a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-array\/\">array<\/a> in place in ascending order. The following shows the syntax of the <code>sort()<\/code> function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sort(<span class=\"hljs-keyword\">array<\/span> &amp;$array, int $flags = SORT_REGULAR): bool<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>sort()<\/code> function has two parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$array<\/code> is the input array to sort.<\/li>\n\n\n\n<li><code>$flags<\/code> argument is one or a combination of multiple flags that change the sorting behavior of the function.<\/li>\n<\/ul>\n\n\n\n<p>The <code>$flags<\/code> parameter defaults to <code>SORT_REGULAR<\/code>. It means that the function will compare elements of the input array using comparison operators.<\/p>\n\n\n\n<p>To combine multiple flags, you use the | character,\u00a0 for example, <code>SORT_STRING | SORT_FLAG_CASE<\/code>. The <code>sort()<\/code> function returns <code>true<\/code> on success or <code>false<\/code> on failure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sorting-an-array-of-numbers'>Sorting an array of numbers <a href=\"#sorting-an-array-of-numbers\" class=\"anchor\" id=\"sorting-an-array-of-numbers\" title=\"Anchor for Sorting an array of numbers\">#<\/a><\/h2>\n\n\n\n<p>The following example uses the PHP <code>sort()<\/code> function to sort an array of three numbers:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$numbers = &#91;<span class=\"hljs-number\">2<\/span>, <span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">3<\/span>];\nsort($numbers);\n\nprint_r($numbers);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRudW1iZXJzID0gWzIsIDEsIDNdOwpzb3J0KCRudW1iZXJzKTsKCnByaW50X3IoJG51bWJlcnMpOw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">Array<\/span>       \n(\n    &#91;<span class=\"hljs-number\">0<\/span>] =&gt; <span class=\"hljs-number\">1<\/span>\n    &#91;<span class=\"hljs-number\">1<\/span>] =&gt; <span class=\"hljs-number\">2<\/span>\n    &#91;<span class=\"hljs-number\">2<\/span>] =&gt; <span class=\"hljs-number\">3<\/span>\n)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This example uses the <code>SORT_REGULAR<\/code> flag.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sorting-an-array-of-strings'>Sorting an array of strings <a href=\"#sorting-an-array-of-strings\" class=\"anchor\" id=\"sorting-an-array-of-strings\" title=\"Anchor for Sorting an array of strings\">#<\/a><\/h2>\n\n\n\n<p>The following example uses the <code>sort()<\/code> function to sort an array of strings alphabetically:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$names = &#91;<span class=\"hljs-string\">'Bob'<\/span>, <span class=\"hljs-string\">'John'<\/span>, <span class=\"hljs-string\">'Alice'<\/span>];\nsort($names, SORT_STRING);\n\nprint_r($names);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRuYW1lcyA9IFsnQm9iJywgJ0pvaG4nLCAnQWxpY2UnXTsKc29ydCgkbmFtZXMsIFNPUlRfU1RSSU5HKTsKCnByaW50X3IoJG5hbWVzKTs\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">Array<\/span>\n(\n    &#91;<span class=\"hljs-number\">0<\/span>] =&gt; Alice\n    &#91;<span class=\"hljs-number\">1<\/span>] =&gt; Bob\n    &#91;<span class=\"hljs-number\">2<\/span>] =&gt; John\n)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This example uses the <code>SORT_STRING<\/code> flag that compares array elements as strings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sorting-an-array-of-strings-case-insensitively'>Sorting an array of strings case-insensitively <a href=\"#sorting-an-array-of-strings-case-insensitively\" class=\"anchor\" id=\"sorting-an-array-of-strings-case-insensitively\" title=\"Anchor for Sorting an array of strings case-insensitively\">#<\/a><\/h2>\n\n\n\n<p>The following example uses the <code>sort()<\/code> function to sort an array of strings:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$fruits = &#91;<span class=\"hljs-string\">'apple'<\/span>, <span class=\"hljs-string\">'Banana'<\/span>, <span class=\"hljs-string\">'orange'<\/span>];\nsort($fruits);\n\nprint_r($fruits);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRmcnVpdHMgPSBbJ2FwcGxlJywgJ0JhbmFuYScsICdvcmFuZ2UnXTsKc29ydCgkZnJ1aXRzKTsKCnByaW50X3IoJGZydWl0cyk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">Array<\/span>\n(\n    &#91;<span class=\"hljs-number\">0<\/span>] =&gt; Banana\n    &#91;<span class=\"hljs-number\">1<\/span>] =&gt; apple\n    &#91;<span class=\"hljs-number\">2<\/span>] =&gt; orange\n)    <\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To sort an array of strings case-insensitively, you combine the <code>SORT_STRING<\/code> flag with the <code>SORT_FLAG_CASE<\/code> flag like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$fruits = &#91;<span class=\"hljs-string\">'apple'<\/span>, <span class=\"hljs-string\">'Banana'<\/span>, <span class=\"hljs-string\">'orange'<\/span>];\nsort($fruits, SORT_FLAG_CASE | SORT_STRING);\n\nprint_r($fruits);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRmcnVpdHMgPSBbJ2FwcGxlJywgJ0JhbmFuYScsICdvcmFuZ2UnXTsKc29ydCgkZnJ1aXRzLCBTT1JUX0ZMQUdfQ0FTRSB8IFNPUlRfU1RSSU5HKTsKCnByaW50X3IoJGZydWl0cyk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">Array<\/span>\n(\n    &#91;<span class=\"hljs-number\">0<\/span>] =&gt; apple\n    &#91;<span class=\"hljs-number\">1<\/span>] =&gt; Banana\n    &#91;<span class=\"hljs-number\">2<\/span>] =&gt; orange\n)    <\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='sorting-an-array-of-strings-using-natural-ordering'>Sorting an array of strings using &#8220;natural ordering&#8221; <a href=\"#sorting-an-array-of-strings-using-natural-ordering\" class=\"anchor\" id=\"sorting-an-array-of-strings-using-natural-ordering\" title=\"Anchor for Sorting an array of strings using &quot;natural ordering&quot;\">#<\/a><\/h2>\n\n\n\n<p>To sort an array of strings in the &#8220;natural ordering&#8221;, you combine the <code>SORT_STRING<\/code> and <code>SORT_NATURAL<\/code> flags. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$ranks = &#91;<span class=\"hljs-string\">'A-1'<\/span>, <span class=\"hljs-string\">'A-2'<\/span>, <span class=\"hljs-string\">'A-12'<\/span>, <span class=\"hljs-string\">'A-11'<\/span>];\nsort($ranks, SORT_STRING | SORT_NATURAL);\n\nprint_r($ranks);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRyYW5rcyA9IFsnQS0xJywgJ0EtMicsICdBLTEyJywgJ0EtMTEnXTsKc29ydCgkcmFua3MsIFNPUlRfU1RSSU5HIHwgU09SVF9OQVRVUkFMKTsKCnByaW50X3IoJHJhbmtzKTs\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">Array<\/span>\n(\n    &#91;<span class=\"hljs-number\">0<\/span>] =&gt; A<span class=\"hljs-number\">-1<\/span> \n    &#91;<span class=\"hljs-number\">1<\/span>] =&gt; A<span class=\"hljs-number\">-2<\/span> \n    &#91;<span class=\"hljs-number\">2<\/span>] =&gt; A<span class=\"hljs-number\">-11<\/span>\n    &#91;<span class=\"hljs-number\">3<\/span>] =&gt; A<span class=\"hljs-number\">-12<\/span>\n)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='php-rsort-function'>PHP rsort() function <a href=\"#php-rsort-function\" class=\"anchor\" id=\"php-rsort-function\" title=\"Anchor for PHP rsort() function\">#<\/a><\/h2>\n\n\n\n<p>The <code>rsort()<\/code> function is like the <code>sort()<\/code> function except that it sorts the elements of an array in descending order. The syntax of the <code>rsort()<\/code> function is as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">rsort(<span class=\"hljs-keyword\">array<\/span> &amp;$array, int $flags = SORT_REGULAR): bool<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For example, the following sorts the <code>$ranks<\/code> array&#8217;s elements using the natural ordering in descending order.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$ranks = &#91;<span class=\"hljs-string\">'A-1'<\/span>, <span class=\"hljs-string\">'A-2'<\/span>, <span class=\"hljs-string\">'A-12'<\/span>, <span class=\"hljs-string\">'A-11'<\/span>];\nrsort($ranks, SORT_STRING | SORT_NATURAL);\n\nprint_r($ranks);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRyYW5rcyA9IFsnQS0xJywgJ0EtMicsICdBLTEyJywgJ0EtMTEnXTsKcnNvcnQoJHJhbmtzLCBTT1JUX1NUUklORyB8IFNPUlRfTkFUVVJBTCk7CgpwcmludF9yKCRyYW5rcyk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">Array<\/span>\n(\n    &#91;<span class=\"hljs-number\">0<\/span>] =&gt; A<span class=\"hljs-number\">-12<\/span>\n    &#91;<span class=\"hljs-number\">1<\/span>] =&gt; A<span class=\"hljs-number\">-11<\/span>\n    &#91;<span class=\"hljs-number\">2<\/span>] =&gt; A<span class=\"hljs-number\">-2<\/span> \n    &#91;<span class=\"hljs-number\">3<\/span>] =&gt; A<span class=\"hljs-number\">-1<\/span> \n)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>sort()<\/code> function to sort elements of an array in ascending order.<\/li>\n\n\n\n<li>Use the <code>rsort()<\/code> function to sort elements of an array in descending order.<\/li>\n\n\n\n<li>Use one or more flags to change the sorting behavior of the <code>sort()<\/code> or <code>rsort()<\/code> functions.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Did you find this tutorial useful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"2073\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-array-sort\/\"\n\t\t\t\tdata-post-title=\"PHP Array Sort\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"2073\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-array-sort\/\"\n\t\t\t\tdata-post-title=\"PHP Array Sort\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to sort an array using the built-in PHP sort() function.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":15,"menu_order":57,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2073","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/comments?post=2073"}],"version-history":[{"count":5,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2073\/revisions"}],"predecessor-version":[{"id":3090,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2073\/revisions\/3090"}],"up":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/15"}],"wp:attachment":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/media?parent=2073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}