Reputation: 39
i have the following php code not returned images containing non-latin character,because their links show weird address.
if($image) {
var_dump(mb_detect_encoding($image, 'UTF-8', true))
$doc = new DOMDocument();
$doc->loadHTML($image);
$imgs = $doc->getElementsByTagName('img');
foreach ($imgs as $img) { ?>
<img data-src="<?php echo $img->getAttribute("src");?>" class="something"/>
<?php }
} ?>
already i have <meta charset="utf-8">
in <head>
.how should i deal with this problem.
Upvotes: 1
Views: 189