I have an array, such as this example:
Array
(
[0] => cinema
[1] => school
[2] => college
[3] => social
[4] => cinema
[5] => School
[6] => COllEGE
[7] => Ccccccc
)
I want only whole words that start from ‘C’ or ‘S’ only one time,
repetition character in word is allowed irrespective of whether they are upper or lower case
Example output:
cinema
college
ccccccc
Use
array_filterwith a simple filter (regex or$val[0] == "c"for instance) andarray_uniqueHere is an example (not tested) :