i am trying to load a string
use PHPHtmlParser\Dom;
$dom = new Dom;
$dom->load('A HUGE HTML STRING ');
$a = $dom->find('a')[0];
echo $a->text; // "click here"
and i get the error
is_file(): File name is longer than the maximum allowed path length on this platform (4096):
i think that you should create a function or give access to loadStr widouth checking if it is a file or not
public function load($str, $options = [])
{
// check if it's a file
if (is_file($str))
{
return $this->loadFromFile($str, $options);
}
// check if it's a url
if (preg_match("/^https?:\/\//i",$str))
{
return $this->loadFromUrl($str, $options);
}
return $this->loadStr($str, $options);
}