Home  >  Article  >  Backend Development  >  写个正则表达式解决方案

写个正则表达式解决方案

WBOY
WBOYOriginal
2016-06-13 11:10:39813browse

写个正则表达式

我爱中国 - 我我我我
提取出来‘我爱中国 - 我我我我',怎么写正则表达式

------解决方案--------------------
$str="<HEAD><TITLE>我爱中国 - 我我我我</TITLE>";<br />preg_match("/\<TITLE\>(.*)\<\/TITLE\>/",$str,$arr);<br />echo $arr[1];exit;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn