I want to replace a number of characters in a string, so I have looked at preg_replace:
preg_replace('/xyz/', '', $val);
Yet the above only replaces instances of xyz and not individual characters. Here is an example of what I want to happen:
preg_replace('/xyz/', '', 'xaybzc'); //abc
preg_replace('/xyz/', '', 'xyzabc'); //abc
preg_replace('/xyz/', '', 'abzxyc'); //abc