Although this is an exercise in logic which, up to the present moment, apparently had no effort on the part of the author demonstrated, I would like to leave my contribution anyway.
The solution is so simple that, apart from the input array, it is solved with only two lines:
$words = [ 'estudar', 'educação', 'esforço', 'persistência',
'dedicação', 'crescimento', 'evolução', 'sabedoria',
'trabalho', 'entusiasmo', 'alegria', 'vitoria',
'sucesso', 'profissão', 'conhecimento', 'vida' ];
$odd = array_filter( $words, function( $word ) { return ( strlen( $word ) % 2 == 0 ); } );
$even = array_diff( $words, $odd );
The arrays $Odd and $Even resulting contains respectively:
array (size=8)
1 => string 'educação' (length=10)
2 => string 'esforço' (length=8)
6 => string 'evolução' (length=10)
8 => string 'trabalho' (length=8)
9 => string 'entusiasmo' (length=10)
13 => string 'profissão' (length=10)
14 => string 'conhecimento' (length=12)
15 => string 'vida' (length=4)
array (size=8)
0 => string 'estudar' (length=7)
3 => string 'persistência' (length=13)
4 => string 'dedicação' (length=11)
5 => string 'crescimento' (length=11)
7 => string 'sabedoria' (length=9)
10 => string 'alegria' (length=7)
11 => string 'vitoria' (length=7)
12 => string 'sucesso' (length=7)
Unlike friend’s @lost statement, use mb_strlen(), in this case, it results in false-positive because it causes the accents of the words to be considered as additional lengths.
Recommended readings:
This question seems to be decontextualized because it seems to be about an exercise of logic which did not demonstrate that there was effort on the part of the author given the absence of a preliminary implementation.
– Bruno Augusto
That’s not a doubt, that’s a statement. Try to start your work, as questions appear you can create questions here on the site so we can help you. Take a [tour] by the site and see the guide [Ask].
– Math
Have you tried to do anything, if yes, how about posting what you tried and if you made a mistake then yes you can have a more assertive help.
– Marcelo Diniz