Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zmiana kodowania pobranych plików, z innej strony
Randallmaster
post
Post #1





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


Witam serdecznie,

Mam kod który pobiera dane z innej strony w formacie plików ico natomiast ja muszę wyświetlić to w utf-8 w jaki sposób mogę to zrobić?

Ten post edytował Randallmaster 12.03.2010, 13:54:48
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Randallmaster
post
Post #2





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


no to tak (IMG:style_emoticons/default/smile.gif)

Ges pomógł* mi napisać kod który zabiera ze strony praca.gradka.pl część strony o to kod (IMG:style_emoticons/default/smile.gif)

  1. <?php
  2.  
  3. $curl = curl_init();
  4. curl_setopt($curl, CURLOPT_URL, "http://praca.gratka.pl/pracownik/szukaj/lista/re_15__fr_Kalisz.html");
  5. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  6.  
  7. $result = curl_exec($curl);
  8. curl_close($curl);
  9.  
  10. //links
  11. $baseUrl = "http://praca.gratka.pl/";
  12.  
  13. if (preg_match_all("#<td>(.*?)</td>#is", $result, $links))
  14. {
  15. foreach ($links[0] as $link)
  16. {
  17. if (preg_match_all("#<a class=\"stanowisko\" href=\"(.*?)\">(.*?)</a>#", $link, $links))
  18. {
  19. foreach ($links[1] as $index => $link)
  20. {
  21. $href = $baseUrl . $link;
  22. print "&nbsp;&nbsp;<img src='images/znak.png'>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$href\" TARGET='_blank'>".$links[2][$index]."</a><br />";
  23. }
  24. }
  25. }
  26.  
  27. }
  28.  
  29. ?>


ale jest on kodowany w ico. pobieram ten plik w innym dokumencie kodowanym utf ponieważ reszta jest w tym kodowana:

  1. <?php
  2. include 'inneoferty/pracagradka.php';
  3. ?>


tym pobieram... teraz pytanie jak to zmienic na utf (IMG:style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 13:53