Replace both upperCase and lowerCase

[b]code[/b]

$myVar = 'abcdABCD';

$myVar=str_replace('a','', $myVar);

echo $myVar;

[b]result[/b]

bcd[COLOR="#FF0000"]A[/COLOR]BCD

The code above replace ‘a’.
I like to replace both “a” and “A” at a time.

Use str_ireplace() — The case-insensitive version of str_replace().
http://php.net/manual/en/function.str-ireplace.php

$myVar = 'abcdABCD';
$myVar=str_ireplace('a','', $myVar);
echo $myVar;
result
bcdBCD

You can use:

$myVar=str_replace(‘a’,‘’, $myVar);
$myVar=str_replace(‘A’,‘’, $myVar);

This will replace both a and A