Jump to content

[SOLVED] How to order a array


redarrow

Recommended Posts

 

 

if i wanted to order the array of

$names_array=array("a c b","b a c","a b c");

 

to show in this order.

 

1.abc

2.acb

3.bac

 

what i am trying to to is get the array values in order of a-z

example of array

<?php

$names_array=array("a c b","b a c","a b c");

foreach($names_array as $test_order){

echo "$test_order\n <br>";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/155612-solved-how-to-order-a-array/
Share on other sites

cheers dan,

 

if i wanted to order the array of a database, and order the meta tag of description will that also work with your posted code.

 

what it is dan, i am creating a add link, web site and i want to show all the added web sites in order of a-z of the description name.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.