load html from string
public load ( $str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT ) |
// Load HTML content from a URL $html = file_get_html('https://www.example.com'); // Find all links and print them foreach($html->find('a') as $element) { echo $element->href . '
'; }
// Load HTML content from a string $html = str_get_html('This example loads HTML content from a string and uses the `find()` method to extract the content from a specific div element and print it. In conclusion, simple_html_dom load is a PHP package/library that provides an easy way to manipulate HTML documents. It is used to parse HTML content, extract data, modify HTML, and more.Hello World'); // Find the content and print it $content = $html->find('.content', 0)->innertext; echo $content;
public load ( $str, $lowercase = true, $stripRN = true, $defaultBRText = DEFAULT_BR_TEXT ) |