fork download
  1. <?php
  2.  
  3. $string = '
  4. iojefu { string1 }
  5. asdjhu { string2 }
  6. ';
  7. $arr = array();
  8. preg_match_all('~{\s*\K\w+~', $string, $arr);
  9. print_r($arr[0]);
  10.  
Success #stdin #stdout 0.02s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => string1
    [1] => string2
)