- var_dump: documentation ( source)
- preg_split: documentation ( source)
<?php
//I want the 'delimX' to be included as well:
$str = "blah blah1 (delim1) blah blah2 (delim2) blah blah3 (delim3) blah blah3";
$result = preg_split ('~\(delim[0-9].*?\)~',$str ,-1, PREG_SPLIT_DELIM_CAPTURE);
var_dump($result);