$url = " http://dev.test/test.php?msg=".$keyword;
我请求一个api返回的是这么一个格式的内容
[msg]我先说[/msg] $output = file_get_contents($url);
求助后续如何解析这个内容并且能获取我先说~~~ 万分感谢~~~~对了请求参数keyword还需要GBK编码~~~~
我请求一个api返回的是这么一个格式的内容
[msg]我先说[/msg] $output = file_get_contents($url);
求助后续如何解析这个内容并且能获取我先说~~~ 万分感谢~~~~对了请求参数keyword还需要GBK编码~~~~
echo '<meta http-equiv="content-type" content="text/html;charset=utf-8">';
$content = '[msg]我先说[/msg]';
preg_match('/\[msg\](.*)\[\/msg\]/is', $content, $matches);echo $matches[1];