I have an array that I need no reorder like this:
If this have "casa-cocina-mesas-" and "casa-cocina-mesas-somethingelse-", the value with more values must keep it, the other must be deleted.
But if we have this "casa-cocina-mesas-somethingelse-" and this "casa-anotherstuff-mesas-somethingelse-", the both must be saved.
And if an value have another differtent value like "electronic-tools" and "electronic-computer-accessory". bot array must be saved.
And i have some values as null too but this value doesn't matter.
-
Finally all the other must be removed.
<?php $category = array("casa-cocina-",null,"casa-","electronic-computer-accessory","electronic-",null,"casa-cocina-mesas-", "casa-cocina-","electronic-","electronic-tools"); ?>