I would take words in several tables to get a sentence.
My first array : $ARRAYTREE
[Choose] => RED
[a] => BLUE
[job] => ORANGE
[you] => YELLOW
[love] => GREEN
[,] => PURPLE
[and] => CYAN
[you] => YELLOW
[will] => BLACK
[never] => GREEN
[have] => BLACK
[to] => CYAN
[work] => ORANGE
[a] => BLUE
[day] => YELLOW
[in] => CYAN
[your] => YELLOW
[life] => ORANGE
[.] => PURPLE
Values of change: PURPLE, BLACK
I managed to get the words from my first array ($ARRAYTREE), getting the following sentence:
"Choose a job you love "
What I’m looking for some time, it is from this end of sentence, to look for the presence of two values PURPLE and CYAN that contact to realize a transition. When these two values are found, it is necessary to take all the keys of the array until time we arrive at a new value of change (PURPLE or BLACK). With array 2 ($ARRAYTREE2), I will get the following words :
", go with all your heart "
My second array : $ARRAYTREE2
[Wheresoever] => GREEN
[you] => YELLOW
[go] => BLACK
[,] => PURPLE
[go] => CYAN
[with] => GREEN
[all] => CYAN
[your] => YELLOW
[heart] => ORANGE
[.] => PURPLE
Giving in the end this character string:
"Choose a job you love , go with all your heart "
I tried with the method of array_search and array_slice but without result ...
Thanks to the person who deigns to answer me...