I am fairly new to php so I am not sure of the names and terms of what I would like to find out here. I did do a search on SE but although the titles of questions are similar, they ask a completely different thing which are unfortunately not partially related even. Excuse me in advance if it exists and I could not find.
I have a string $str= 'somevalue';
or an $array = ['s', 'o', 'm' ..];
Now, I have an other array which is 2 dimensional, of which 1st items I want to check against this main array and depending on whether they exist or not, add the 2nd item.
$to_match[] = ('match' => 'rnd_letter', 'if_not_add' => 'someval');
$to_match[] = ('match' => 'rnd_letter', 'if_not_add' => 'someval_x');
..
rnd_letter is a letter or combination of letters and someval is the same.
How can I check if letter(s) in 'match' exists in $str, and if not, add to the end letters of 'if_not_add' of the array?
Thank you very much.