Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][CURL] Problem dane
zabolek
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 21.05.2010

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


Witam mam problem jak zrobic zeby sprawdzal czy istnieje dany kod np

<script>
sadsaddsa
</script>

a jak nie ma to aby pisal brak

napisalem takie cos i maly problem ;/

  1. $pageurl = "$domain";
  2. $ch = @curl_init($pageurl);
  3. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  4.  
  5. curl_setopt ($ch, CURLOPT_URL, $pageurl );
  6. $html = curl_exec ( $ch );
  7. curl_close($ch);
  8.  
  9. //then you need to fix pathing to absolute
  10. $search = "<head>";
  11.  
  12. preg_match_all ( $search, $html, $a_matches );
  13. if($a_matches[1]=='')
  14. {
  15. echo 'Kod Znaleziono';
  16. }elseif($a_matches[0]) {
  17. echo 'Brak Kodu';
  18. }
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: 27.12.2025 - 04:55