|Sorting data and limiting data in PHP|
In PHP, the sort() function is used to sort an indexed array in ascending order and rsort() function is used to sort an indexed array in descending order.
Here in the above syntax you have seen different parameters which have been used. Let’s have a look for what purpose they have been used.
Sort the elements of the $numbers array in ascending numerical order:
In PHP,LIMIT () Function is used to specify the number of records to return.
If you want to select records from 1 – 40 from a table employees. Then the code will be
$sql = “SELECT * FROM employees LIMIT 40”;
When the SQL query is run, it will return the first 40 records.
Tags PHP and MYSQL
PHP also allows you to copy, rename, and delete files. The functions to perform these …