I need to convert an HTML table (rows and columns) to PHP array. for example:
<tr>
<th rowspan="2">Username</th>
<th colspan="2">Personal</th>
</tr>
<tr>
<th>Name</th>
<th>Birth date</th>
</tr>
in PHP I need it to become:
array(
[0] => array(
[0] => array(
["value"] => "Username",
["rowspan"] => "2"),
[1] => array(
["value"] => "Personal",
["colspan"] => "2")
),
[1] => array(
[0] => array(
["value"] => "Name"
),
[1] => array(
["value"] => "Birth date"
)
)
);
So, the idea is that, the first array will keep the rows, inside each row I want to have an array of columns and inside of columns I want an array with the value of the cell and the attributes, I just need attributes like rowspan and colspan. so if you got the idea and know how to do it please share, I don't need you to do it for me, I just need to know how can I do this.