Home  >  Article  >  Backend Development  >  php获取某个网站了内容 而且保存为TXT 下次直接从txt读取

php获取某个网站了内容 而且保存为TXT 下次直接从txt读取

WBOY
WBOYOriginal
2016-06-13 11:19:571217browse

php获取某个网站了内容 并且保存为TXT 下次直接从txt读取
php获取某个网站了内容 并且保存为TXT 下次直接从txt读取
file_put_contents  好像可以保存!  
具体怎么写! 不会写啊!

代码如下!

<br /><?php <br />function get_flash_url( $url ) <br />{ <br />$lines = file($url); <br />foreach ($lines as $linenum=> $line) { <br />preg_match_all('|<title>([^<>]+)</title>|',$line,$result); <br />$swfurl=$result[1][0]; <br />if(!empty($swfurl)) <br />return $swfurl; <br />} <br />} <br />?><?php <br />$url=$_SERVER["QUERY_STRING"]; <br />$flashurl= get_flash_url($url); <br />echo preg_replace("/[&,?]/","",$flashurl);<br />?><br />


------解决方案--------------------
这个取得了flash的路径 完后你要把路径给写到一个text内?
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