Wrote a sample:

$ret = $html->find('.firminfo h1 abbr'); print_r($ret); 

The result was:

 Array ( [0] => simple_html_dom_node Object ( [nodetype] => 1 [tag] => abbr [attr] => Array ( [title] => Значение поля ) [children] => Array ( ) [nodes] => Array ( [0] => simple_html_dom_node Object ( [nodetype] => 3 [tag] => text [attr] => Array ( ) [children] => Array 

So, how can I remove the value from the very beginning, right here [attr] [title] => Field value?

  • I wanted it like this, but it didn't work out: echo $ ret-> title. '<br>'; - oldzas

1 answer 1

As print_r suggests, $ ret is an array with one single element.

This element, among other properties, has the required attr , which in turn is an associative array with a single element (key title => value Значение поля )

Therefore, in order to get the desired value, you need to do this:

 $value = $ret[0]->attr['title']