PHP正则表达式匹配标签之后的内容

<?php
$s1 = '[img]http://127.0.0.1/55.jpg
[png]http://127.0.0.1/55.png
[gif]http://127.0.0.1/55.gif
[style]7
[height]698
[top]390
[bg]#00679a'
preg_match_all(?????,$s1,$p1);
echo "<pre>";
print_r($p1[0]);
?>
最终要输出的独立结果是:(标签不要)
http://127.0.0.1/55.jpg
http://127.0.0.1/55.png
http://127.0.0.1/55.gif
7
698
390
#00679a
本人比较菜,望大神指点。。
本人菜鸟,没有财富值,如能帮我搞定,我帮大神充30块话费。小弟我穷。

$s1 = '[img]h和谐ttp://127.0.0.1/55.jpg
[png]htt和谐p://127.0.0.1/55.png
[gif]ht和谐tp://127.0.0.1/55.gif
[style]7
[height]698
[top]390
[bg]#00679a';
if (preg_match_all ( "/\[[^\[\]]+\]([^\r\n]+)/", $s1, $m )) {
for($i = 0; $i < count ( $m [1] ); $i ++) {
echo $m [1] [$i] . "\n";
}
}

追问

温馨提示:答案为网友推荐,仅供参考
相似回答