I have an array of superheroes named $heroes
:
$heroes=array("Hulk","Spiderman","IronMan");
and I have an array of basic powers named $powers
:
$powers=array("Strong","Webs","Machine");
I would like to sort the $heroes
array alphabetically, so that it displays this:
$heroes=array("Hulk","IronMan","Spiderman");
and with this, I would like the powers to be sorted based on the $heroes array so that it displays this:
$powers=array("Strong","Machine","Webs");
I would not like to use a two dimensional array - I need them to be in seperate arrays. Any ideas?