Hi, I need your help to extract some code form one html page.
I take this code from html page:
I use this code, but it's not finished yet
What I need is to:
I need to return two separate value, for category and tags, and insert them later into database..
How can I extract them?
Thanks
I take this code from html page:
PHP:
<div class="shareWrapper rounded">
<ul class="listCat">
<li><b>Categories:<br /></b>
<a href="/category/26/category 1/">Category 1</a>
</li>
</ul>
<ul class="listCat">
<li>
<b>Tags:<br /></b>
<a href="/tags/tag1/">tag 1</a><br /><a href="/tag/tag2/">tag 2</a><br /><a href="/tag/tag3/">tag3</a>
</li>
</ul>
</div>
I use this code, but it's not finished yet
PHP:
foreach($videoContent->find("ul[class=listCat]") as $content)
{
foreach($content->find('li') as $li)
{
$tags[] = $li;
}
}
foreach($tags as $tag)
{
$tag = strip_tags( $tag );
$tagFinal .= $tag;
}
echo '<b>Tags2 : </b>' .$tagFinal. '<br>';
What I need is to:
- Check is Category is set
- make 2 variables, 1 for category (if exists) and 1 for tag with their content
I need to return two separate value, for category and tags, and insert them later into database..
How can I extract them?
Thanks