Return to Snippet

Revision: 14225
at May 25, 2009 07:41 by Gustavs


Initial Code
preg_match('/\<div id\=[\"]{0,1}ad_content[\"]{0,1}\>(.*?)\<\/div\>/s', $content['content_body'], $matches);
$content['content_body'] = $matches[1];

Initial URL


Initial Description
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

Initial Title
Regular Expression to get contents of div[id]

Initial Tags
regex, php

Initial Language
PHP