I am trying to remove a piece of text from a string, but the text has a variable in the middle that makes it hard to make a match, how can I make a variable search and delete with PHP?
The text is "<div class="about_us_item"><h2>Privacy Policy</h2><div>::cck::34::/cck::<br>::introtext::<h3>Introduction</h3><p>John Blogs respects the privacy of each Visitor."
The part that needs to be stripped is "::cck::34::/cck::<br>::introtext::"
but the "34"
is the variable as it is an ID, so it could be "::cck::203::/cck::<br>::introtext::"
I have tried:
$html='"<div class="about_us_item"><h2>Privacy Policy</h2><div>::cck::34::/cck::<br>::introtext::<h3>Introduction</h3><p>John Blogs respects the privacy of each Visitor."';
$regex='/::cck::*::/cck::<br>::introtext::/';
preg_match ($regex,$html,$matches);
echo $matches;
Any help would be appreciated.
Thanks