-3

I have a problem to displaying text. How to remove � this character from string.

I am getting the follow,

It�s back to the beginning for Tom Clancy�s CIA operative in this prequel/origin story. It�s back to the beginning for Tom Clancy�s CIA operative in this prequel/origin story.

Satish Sharma
  • 9,547
  • 6
  • 29
  • 51
user2861298
  • 101
  • 1
  • 8

2 Answers2

0

Run this code

$str = 'It�s back to the beginning for Tom Clancy�s CIA operative in this prequel/origin story. It�s back to the beginning for Tom Clancy�s CIA operative in this prequel/origin story.';
$str = filter_var($str,FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_HIGH);
echo $str ;
Anju Aravind
  • 3,262
  • 2
  • 16
  • 22
0

Using filter_var function you can remove the unwanted character.It Filters a variable with a specified filter

$str = 'your string'


$str = filter_var($str,FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_HIGH);

echo $str;

It Returns the filtered data, or FALSE if the filter fails.

Documentation is found here http://php.net/manual/en/function.filter-var.php

Avinash Babu
  • 6,171
  • 3
  • 21
  • 26