Docs say
[attribute^=value] Matches elements that have the specified attribute and it starts with a certain value.
so this code:
<?php
include 'simple_html_dom.php';
echo count(
str_get_html("<html><body><span class='first second'>Hello!</span></body></html>")
->
find('span[class^=second]')
);
should output 0. On V1.5, it outputs 1.
It's possible behaviour is intended (since it can be useful) and the bug is in the documentation.
Thanks for reporting this issue!
I've used your testing data to verify that it works in latest version.
Last edit: Jeffrey Kastner 2022-05-05