I have an array like this $a=("something","something else","another something"); and another array like this $b=("b","bb").
I would like to produce an $a = array("something"=>Array("b","bb"),"something else","another something");. How can achieve this?
Try array_map for more flexibility:
Consider that you’re essentially asking a map-reduce question, where you seek a function to perform a given action upon a condition.
With this answer, you could iterate over your base array and re-map certain values
See also, array_reduce, array_filter, and the generic array_walk