5

I'm fetch the html content using below code,

preg_match_all('/<div class="content">(.*?)<\/div>/s', $str, $matches);
echo $matches[1][0];

Content fetched correctly but some special char whit text not display properly like

“response to what?” display as “response to what?â€

but it doesn’t display as but it doesn’t matter. and some blanck space display as Â

how to resolve this issue..?

Wiram Rathod
  • 1,895
  • 1
  • 19
  • 41

2 Answers2

2

You have unicode issues, try adding this as the first line in your script :

header('Content-Type: text/html; charset=utf-8');
Oussama Jilal
  • 7,669
  • 2
  • 30
  • 53
1

first add this line in your code...(above)

   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
thumber nirmal
  • 1,639
  • 3
  • 16
  • 27