Identifying images referenced in HTML |
[eluser]cwt137[/eluser]
[quote author="SitesByJoe" date="1234249784"]It'd be much easier to get that info with javascript being that PHP doesn't know the DOM. Is that out of the question? If not, you're gonna have some beefy regex-type work ahead of you.[/quote] What? PHP doesn't know DOM? http://us2.php.net/manual/en/book.dom.php Below is an example I put together in a few minutes on how to get every file name contained in the src attibute of a img tag. I don't use PHP's DOM API much so this solution might not be best but it gets the job done. Code: <?php |
Messages In This Thread |
Identifying images referenced in HTML - by El Forum - 02-09-2009, 03:16 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 03:26 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 03:28 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 03:50 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 04:53 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 07:09 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 07:12 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 08:01 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 08:03 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 08:07 PM
Identifying images referenced in HTML - by El Forum - 02-09-2009, 09:34 PM
|