I’m new to PHP so I don’t know it’s specific characteristics, what I’m trying to do is get the content in a <div> tag for an RSS feed. here’s what I have so far:
$txt = file_get_contents(‘
preg_match_all (“/<div class=”mainpost”>([^`]*?)</div>/”, $txt, $cont);
which is what is supposed to take the content from <div class=”main”>content</div>, but is giving me nothing.
If I do:
echo sizeof($cont);
it outputs 2. If I say echo $cont[0] . $cont[1]; it outputs ‘ArrayArray’, which I’m assuming means it created a 2d array, but the problem is sizeof($cont[0]) and sizeof($cont[1]) both return 0. I know that it can read the text because if I echo $txt it shows mywebsite.com, so I’m assuming that I have a problem with the regex that I’m using in preg_match_all.
Thanks for the help.