下記コードで var_dump($matches); したものが文字化けしてしまうのですが、原因が分からず時間が経過してしまっております。
恐縮ですがどなたか教えて頂けませんでしょうか。
php
1<!doctype html> 2<html> 3 <head> 4 <META http-equiv=content-type content="text/html; charset=UTF-8"> 5 </head> 6 <body> 7 8<?php 9echo mb_internal_encoding(); 10header("Content-type: text/html;charset=utf-8"); 11 12mb_internal_encoding('UTF-8'); 13mb_http_output('UTF-8'); 14mb_http_input('UTF-8'); 15mb_regex_encoding('UTF-8'); 16 17$html = file_get_contents("http://affiliate.rakuten.co.jp/trend//?l-id=top_keyword_sonota", NULL, NULL, 101); 18 19mb_convert_encoding($html, "UTF-8","EUC-JP"); 20 21preg_match_all("/<font size=\"-1\">(.*?)<a href=\"(.*?)\">(.*?)<\/a><\/font>/", $html, $matches); 22var_dump($matches); 23 24?>
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/11/09 09:59