Skip to content

Instantly share code, notes, and snippets.

@crishnakh
Created January 13, 2013 21:59
Show Gist options
  • Save crishnakh/4526417 to your computer and use it in GitHub Desktop.
Save crishnakh/4526417 to your computer and use it in GitHub Desktop.
"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" from http://snipplr.com/view/15302/
<?php
preg_match('/\<div id\=[\"]{0,1}ad_content[\"]{0,1}\>(.*?)\<\/div\>/s', $content['content_body'], $matches);
$content['content_body'] = $matches[1];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment