我有这个代码的HTML网页:
<div class="col-sm-9 xs-box2">
<h2 class="title-medium br-bottom">Your Name</h2>
</div>
现在我想使用Simple HTML DOM Parser在这个div中获取h2的文本值。我的代码是:
$name = $html->find('h2[class="title-medium br-bottom"]');
echo $name;
但它总是会返回错误:“
Notice: Array to string conversion in C:\xampp\htdocs\index.php on line 21
Array
我该如何解决这个错误?