I have a very trivial problem with str_replace.
I have a string with the En Dash character ( - ) like this:
I want to remove - the dash
I tried everything and nothing worked. but in the end with the help of http://www.ascii.cl/htmlcodes.htm
this code did work for me
$arr1 = explode(",","0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F");
$arr2 = explode(",","B,C,D,E,F");
foreach($arr2 as $t1){
foreach($arr1 as $t2){
$val = $t1.$t2;
$desc = str_replace(chr(hexdec($val)),"",$desc);
}
}
// if need removing individual value
$desc = str_replace(chr(hexdec('A2')),"",$desc);