- var_dump: documentation ( source)
- preg_replace_callback: documentation ( source)
<?php
function short_check($a) {
var_dump($a);
if($a[1]==$a[2]) return '';
return $a[0];
}
$_content = 'hello [shortcode some params]inner content[/shortcode] there';
$_content = preg_replace_callback('#\[(\S+)[^\]]+[^\[]+\[\/(\S+)\]#iu', 'short_check', $_content);
echo $_content;