<?php $string = '[RAND_15]d4trg[RAND_23]';$match = array();preg_match_all('#\[RAND_.*?]#', $string, $match);var_dump($match);preg_match('#\[RAND_.*?]#', $string, $match);var_dump($match);
Standard input is empty
array(1) { [0]=> array(2) { [0]=> string(9) "[RAND_15]" [1]=> string(9) "[RAND_23]" } } array(1) { [0]=> string(9) "[RAND_15]" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!