Tuesday 15 April 2014

how to sort this array in php -



how to sort this array in php -

this array , i'm seek send email skills of user, email repeating,

abc@yahoo.com | angular js abc@yahoo.com | jquery efg@gmail.com | linux efg@gmail.com | jquery efg@gmail.com | angular js xyz@esapienz.com | jquery xyz@esapienz.com | angular js pqr@esapienz.com | linux pqr@esapienz.com | microsoft dot net pqr@esapienz.com | angular js

but want split array order email-id

abc@yahoo.com | {angular js, jquery} efg@gmail.com | {linux, jquery, angular js} xyz@live.com | {jquery, angular js} pqr@live.com | {linux, microsoft dot net, angular js}

please help, thanking in advance...

just precise : want "group", not "sort" here illustration :

$newarray = []; foreach($your_array $row){ // [0] gets email, [1] gets skill $newarray[$row[0]][] = $row[1]; } ksort($newarray);

php arrays sorting

No comments:

Post a Comment