breaststroke
Programmer
Hello!
I am not sure about what (and how) function to use to order the elements of an array.
I have an array whose elements are strings and these are like sentences. I would like to order it by alphabetical order of the first word after the first space.
For instance, if this is the array:
$thisarray= ("strangers in the night", "i cant think", "a problem to be solved"):
it would become the following, afterwards:
$thisarray= ("i cant think", "strangers in the night", "a problem to be solved");
because "cant" comes before "in" which comes before "problem" in an alphabetical order.
Any hint, please? I would appreciate it!
enjoy practicing languages at:
I am not sure about what (and how) function to use to order the elements of an array.
I have an array whose elements are strings and these are like sentences. I would like to order it by alphabetical order of the first word after the first space.
For instance, if this is the array:
$thisarray= ("strangers in the night", "i cant think", "a problem to be solved"):
it would become the following, afterwards:
$thisarray= ("i cant think", "strangers in the night", "a problem to be solved");
because "cant" comes before "in" which comes before "problem" in an alphabetical order.
Any hint, please? I would appreciate it!
enjoy practicing languages at: