I'd love some help with this small problem.
I need PHP to collect HTML. Lets say, this is a part of the full HTML code:
<div class="inner">
<p>Hi there. I am text! I'm playing hide and seek with PHP.</p>
</div>
My goal is to collect everything between <p>
and </p>
. This is the PHP I've got so far:
$file = file_get_contents($link); //Import le HTML
preg_match('<div class="inner">
<p>(.*?)</p>
</div>si', $file, $k); //Play find & seek
$k_out = $k[1];
$name = strtok($k , '#'); //Remove everything behind the hashtags
echo $name;
But - sadly - PHP error'd me:
*Warning: preg_match(): Unknown modifier '<' in /home/fourwonders/alexstuff/vinedownloader/public_html/v/index.php on line 131*
Can you help me out? At least, thanks for reading!