提取大括号正则表达式php之间的所有值

我有这个表格的内容
$content ="<p>This is a sample text where {123456} and {7894560} ['These are samples']{145789}</p>";

我需要数组中的大括号之间的所有值,如下所示:

array("0"=>"123456","1"=>"7894560","2"=>"145789")

我试过这个代码:

<?php
preg_match_all("/\{.*}\/s",$content,$matches);
?>

但是,我从这个值得从第一个大括号到最后发现的内容.可以通过以上格式获取阵列?我知道我使用的模式是错误的.要获得上述所需的输出应该给予什么?

这样做…
<?php
$content ="<p>This is a sample text where {123456} and {7894560} ['These are samples']{145789}</p>";
preg_match_all('/{(.*?)}/',$matches);
print_r(array_map('intval',$matches[1]));

输出:

Array
(
    [0] => 123456
    [1] => 7894560
    [2] => 145789
)

相关文章

jquery.validate使用攻略(表单校验) 目录 jquery.validate...
/\s+/g和/\s/g的区别 正则表达式/\s+/g...
自整理几个jquery.Validate验证正则: 1. 只能输入数字和字母...
this.optional(element)的用法 this.optional(element)是jqu...
jQuery.validate 表单动态验证 实际上jQuery.validate提供了...
自定义验证之这能输入数字(包括小数 负数 ) &lt;script ...