PHP Simple HTML Dom hyphenated attribute with "find" -


I can not find PHP simple HTML dom to get data from custom data attributes

I The code changes that are made, it just returns all types of elements and data, and not just custom data attributes such as code - such as data-XYZ .

I have read other questions / answers that suggest using the {} , but I do not have to do this work that I can write quotes, apopropas, square braces etc. How to make curly braces around

Example of HTML I'm trying to extract the data from:

    
  foreach ($ html-> search ('[data-name]') as $ data {echo $ data- & Gt; Plain text; Echo "& lt; br & gt;"; }  

I want data from custom attributes in li : data-name
data-info
data-address

What am I currently receiving from H3 link to data A, B, C, D - and & lt; P & gt; Regions

How do I apply $ html-> search ('[data-name]' to them if I just use {} ) Can i ?

It should look like this:

  $ html->; (Find '[Data-Name]', 0) - & gt; {'Data-name'}  

Comments