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 can I reverse sort an array keeping the correlation between the index and value?


This is done using the arsort function:

<?php
$myworld 
= array("a"=>"everything","b"=>"nothing","c"=>"is");
arsort($myworld);
print_r($myworld);
?>


Which prints this:

Array
(
[b] => nothing
[c] => is
[a] => everything
)



ASK A QUESTION

More arrays PHP Questions

HOW CAN I DELETE ALL THE ELEMENT OF THE ARRAY

in .$array->description doesn't work "description" is suppose to stay black and turns colored and is ignored Why?

How do I turn an array into a string?

what are php array functions?

How do I write my own sort function?



Custom Search