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($matches); echo print_r($ids);
Output for 4.3.0 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => a [1] => a [2] => a [3] => a [4] => a [5] => a [6] => a [7] => a [8] => g [9] => a [10] => l [11] => l [12] => e [13] => r [14] => y [15] => a [16] => a [17] => a ) ) Array ( [0] => 2727 [1] => 2726 [2] => 2721 ) 1
Output for hhvm-3.10.0

Process exited with code 153.