/ Published in: PHP

This allows you to get contents of any div with ID tag.
$matches[0] returns with parent div tag
$matches[1] returns with out parent div tag
$matches[0] returns with parent div tag
$matches[1] returns with out parent div tag
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
preg_match('/\<div id\=[\"]{0,1}ad_content[\"]{0,1}\>(.*?)\<\/div\>/s', $content['content_body'], $matches); $content['content_body'] = $matches[1];
Comments
