Ecco un esempio:
<?php
$mystring = 'La {mia casa} è {molto} grande';
preg_match_all('/(?<={)(.*?)(?=})/', $mystring, $matches);
var_dump($matches);
/* Output:
array(2) {
[0]=>
array(2) {
[0]=>
string(8) "mia casa"
[1]=>
string(5) "molto"
}
[1]=>
array(2) {
[0]=>
string(8) "mia casa"
[1]=>
string(5) "molto"
}
}
*/
source:
https://stackoverflow.com/a/1454936/874578