PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I reverse sort the members of an array?


If you wish to reverse sort the members of an array by their values, then you need to use rsort, for reverse sort, instead of sort.

Again this takes the name of the array as its parameter and here's a little example for you:

<?php
$myworld 
= array("it","better","make","you");
rsort($myworld);
print_r($myworld);
?>


printing to the screen:

Array
(
[0] => you
[1] => make
[2] => it
[3] => better
)



ASK A QUESTION

More arrays PHP Questions

i have a site named profile.php where i want to replace the following: http://www.youtube.com/watch?v=yoXE031j8d0 into: i know i could use str_replace to replace into ... but i need to know the URL so i can check if it rea

How may I keyboard replace the value of one cell of the array and the save that row to MySQL using PHP ?

How do I remove and view the last element of an array?

I want to invert my value in array how can I do this?

How can I sort an array keeping the correlation between the index and value?



Custom Search