Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> simple_html_dom zapis do bazy, jak zapisać
michalbd93
post
Post #1





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 23.11.2017

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


  1. $html = file_get_contents('https://www.strona.pl');
  2. //Create a new DOM document
  3. $dom = new DOMDocument;
  4.  
  5. //Parse the HTML. The @ is used to suppress any parsing errors
  6. //that will be thrown if the $html string isn't valid XHTML.
  7. @$dom->loadHTML($html);
  8.  
  9. //Get all links. You could also use any other tag name here,
  10. //like 'img' or 'table', to extract other tags.
  11. $links = $dom->getElementsByTagName('a');
  12.  
  13. //Iterate over the extracted links and display their URLs
  14. foreach ($links as $link){
  15. // tutaj chce zapisać do bazy danych informacje normalnie sie wyswitlają ale nie zapisuje do bazy
  16. }
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: 13.10.2025 - 19:27