提取所要的内容如何提内容

WBOY
Release: 2016-06-13 10:15:09
Original
828 people have browsed it

求助:提取所要的内容怎么提内容

HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->                                     演员:                                                                   何美婷                                      温兆伦                                                                                                                    导演:                                                                   李添胜                                                                                                                                        地区:                                   香港                                                                                                                                                                        类型:                                                                                                                                          喜剧                                                                      都市                                                                                                                            年代:                                  1986                                                                                            简介:                                                                        《城市故事》为单元式处境喜剧,透过一群富有特色及代表性的人物,勾画出在香港这个社会里人与人之间的微妙关系。该剧导演李添胜,监制梁材远,演员有曾近荣、丁茵、温兆伦、刘淑华、郭晋安、唐丽球、罗嘉良、吴茜薇、彭健新、陈有后、罗国维、何美婷等。《城市故事》围绕着几户香港典型的家庭及人物,讲述了各人的生活、工作及冲突,刻画出现代香港人的心态、思想及愿望。                                                               
Copy after login


我要得到演员名字 导演: 年代: 简介:
分别存下来,我该怎么操作。

------解决方案--------------------
PHP code
$html    =<font color="#e78608">------解决方案--------------------</font><br>
Copy after login
PHP code
//数据略,假定已存放在 $s 中preg_match_all('/(\S+:)|(\S+)/s', $s, $r);foreach($r[1] as $i=>$v) {  if($v) $k = $v;  else $res[$k][] = $r[2][$i];}print_r($res);<br><font color="#e78608">------解决方案--------------------</font><br>
Copy after login
PHP code
preg_replace("/([\S]*):\s*(.*?)\s*(?=(([\S]+):)|$)/se", '$res["\\1"]=preg_split("/\s+/", "\\2")', $html);print_r($res);<div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!