Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用代码类获取 div 的内容,当执行此 PHP 代码时,它会获取整个 html 文件而不是指定的内容。我不知道我做错了什么。任何帮助,将不胜感激!
问候
$html = new simple_html_dom(); $html->load_file($url); $content = $html->find('.code'); $new = $html->plaintext; echo nl2br($new);