P3) Separating Elements of a 2 * 3 table Write a function that receives a string that is the HTML code of a 2*3 table (t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

P3) Separating Elements of a 2 * 3 table Write a function that receives a string that is the HTML code of a 2*3 table (t

Post by answerhappygod »

P3) Separating Elements of a 2 * 3
table
Write a function that receives a string that is the HTML code of
a 2*3 table (table might have a header or not have one) and then
separates all the 2*3 elements in the table and returns them as an
array 1*6.
For example if we submit the following table as the string
input:
"<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>"
The output should be the
the arrray {"Jill", "Smith", "50", "Eve", "Jackson", "4"}
please use PHP code for the problem, post the details
and result on the below. Thank you.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply