21,893
社区成员




<?php
$str = "....................<msg>xxxxxxx</msg>....................";
preg_match('#<msg>(.*)</msg>#',$str,$content);
file_put_contents('a.txt',$content[1]);
?>
$ab = "123456abcd123456abcd<msg>yourobject</msg>123456abcd";
if(preg_match_all('/^.*<msg\>(.*)<\/msg>.*$/',$ab,$reg)){
var_dump($reg[1]);
}