3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // example code $content = 'dasdasdas d asdas dasdas dasd [gallery ids="2727,2726,2721"] dasd as ads'; $ids = substr(strstr($content, '[gallery ids='), 14); $ids = substr($ids, 0, strpos( $ids, '"]')); $ids = explode(',', $ids); $your_shortcodes = preg_match_all( '#[gallery*.*?]#s', $content, $matches ); print_r($your_shortcodes); echo print_r($ids);
Output for 4.3.0 - 7.1.0
18Array ( [0] => 2727 [1] => 2726 [2] => 2721 ) 1