How could I remove duplicates of characters found in array $a
from string $b
only if they are found next to each other?
$a = array("a","b","c");
$b = "aabcccdef";
Output should be
abcdef
Characters can be found with a regex but I have no idea how to detect if the characters are next to each other.