Hope someone could help me because I'm not aware with regex.
I need to extract data included in a classic html page to a PHP array.
The HTML code is as below :
<html>
...some html code...
<div data-companycounter="9879" data-code="A" data-seatcounter="9783" class="">
...some html code...
<div data-companycounter="9879" data-code="B" data-seatcounter="9784" class="">
...some html code...
<div data-companycounter="11397" data-code="A" data-seatcounter="11509" class="">
...some html code...
</html>
And I would like to extract some data in an array like this :
$companycounter = [
9879 => [
'A' => 9783,
'B' => 9784,
],
11397 => [
'A' => 11509
]
];
Hope it's clear enought. Thank for those who can help me
DOMDocumentclass it would be easy to extract data. could you please check my answer out!