Closed cavewebs closed 5 years ago
foreach ($table as $k => $v) {
$table[$k][4] = '<a href=" . $v[4] . "><img src="profile.jpg"></a>'
}
?
I was able to get the link by using an if condition in the second loop to check (if $1==4)
like so
$table = $crawler->filter('table')->filter('tr')->each(function ($tr, $i) {
return $tr->filter('td')->each(function ($td, $i) {
if ($i==4) {return $td->filter('a')->extract('href')[0]; }
else{ return trim($td->text()); }
});
});
No más correos por favor
Esdras Pallarco
El 10 ene. 2019, a la(s) 10:44 a. m., Timchosen Uzua notifications@github.com escribió:
Closed #367.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
I have html table and I want to make array from the table
As you can see, the last column is a link while the others are text, I want to extract the text and link so that my array must look like this
I now can use this function below to get the text from the table
but the last column is a link how do i capture it using link()?