is there a really easy way to grab the text of a rel attribute i.e
<a href='#' rel='i want this text here'></a>.
I have tried this morning with regex but am having no luck.
is there a really easy way to grab the text of a rel attribute i.e
<a href='#' rel='i want this text here'></a>.
I have tried this morning with regex but am having no luck.
This should work:
preg_match_all('%<a[^>]+rel=("([^"]+)"|\'([^\']+)\')[^>]*>%i', $html, $matches);
print_r($matches);