0

I am having problem with this code as I am not getting the required output.

I need to collect content include between two tags.

I used:

$p_d=preg_match("/<a class=\"production-details-works\">(.*?)<div class=\"production-details-synopsis\".+>/s",$f);

Where $f is HTML content I already parse. $p_d is variable where I have to store my new content.

Tags I have used in preg_match already content more tags like <strong> and <br> and <p>. I need content with including these tags as I have to replace <br> tag with some other text.

Please help.

Biffen
  • 6,249
  • 6
  • 28
  • 36
M.V.P
  • 9
  • 2
  • $p_d=preg_match("/

    (.*?)

    /s",$f);
    – M.V.P Feb 02 '16 at 13:49
  • 1
    "Please help", "need help" and "want to" aren't used for questions, but support requests; which are off-topic. Your 'question' lacks proper input examples and reasoning on why you're not using a HTML traversal library alternatively to a regex. – mario Feb 02 '16 at 14:12
  • I am using simple_html_dom.php – M.V.P Feb 02 '16 at 14:22
  • simple_html_dom.php is used in code..........I got $f from it now I wont particular content from $f through preg_match. I cant use 'find' again as html code is complex and different. Content is between two tags as I mentioned.so want to use preg_match if you have any other way you are welcome to solve it. – M.V.P Feb 02 '16 at 14:29

0 Answers0