17
You have for every $patterns[] a corresponding $replacements[].
When I ask you what the replacement was for $patterns[] = "/
/sU";, then I wanted to know what was on the $replacements[]= line is.
If you have a lot of patterns and replacements then it is possible that some rules may interfere with each other. Position is then crucial. Start always from 'complicated' to 'simpler'.