Cześć
Mam problem z wyświetlaniem polskich znaków w tekście pobranym z innej strony:
http://www.proz.com/search/?term=board+of+directors&from=eng&to=pol&bidirectional=1&exact_match=1&entire_phrase=1&es=1&discs=6,4,5
Mogę wyświetlić polskie znaki gdy wyświetlam inny tekst, np wpisując echo "żźżźćą".
<?php
header('Content-Type: text/html; charset=utf-8');
$post = "action=term_search&search_params%5Bterm%5D=board+of+directors&search_params%5Bfrom%5D=eng&search_params%5Bto%5D=pol&search_params%5Bbidirectional%5D=true&search_params%5Blanguage_depth%5D=0&search_params%5Bdiscs%5D%5B%5D=6&search_params%5Bdiscs%5D%5B%5D=4&search_params%5Bdiscs%5D%5B%5D=5&search_params%5Bexact_match_fragments%5D=false&search_params%5Bexact_match%5D=true&search_params%5Bentire_phrase%5D=true&search_params%5Bwhole_words%5D=true&search_params%5Bfolding%5D=true&search_params%5Bopen_new_window%5D=true&search_params%5Badv_ops_open%5D=false&search_params%5Bseparate%5D=false&search_params%5Bhighlight%5D=true&search_params%5Bresults_start%5D=0&search_params%5Bresults_per_page%5D=25&search_params%5Bfrom_asearch%5D=false&search_params%5Bfrom_toolbar%5D=false&search_params%5Bsearch_all_discs%5D=true&search_params%5Bsearch_all_disc_specs%5D=true&search_params%5Buniq%5D=c7a8&save_settings=false&from_pager=false";
$ch = curl_init();
$agent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0";
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL, 'http://www.proz.com/ajax/ajax_search.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
$pattern = '/<td>(<a(?!\sname).*?\/a>).*?(<a.*?\/a>)/';
preg_match_all($pattern,
$server_output,
$out);
echo "żźćąóś".'<br>';
for ($i = 1; $i < (count($out)-1); $i++) {
$a= count($out[$i]);
for ($y = 0; $y < $a; $y++) {
echo $out[$i][$y]." ".$out[$i+1][$y].'<br>';
}
}
?>
Z góry dzięki.
Łukasz