如果樱花下落的速度是五厘米每秒,那么当两颗心靠近的时间是多少?

桐崎千棘

当前位置 : 首页 > 学习 > php获取网页源代码并朗读

php获取网页源代码并朗读

摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>浏览</title>


<?php

$url=$_GET['url'];

 $ch = curl_init(); 

$timeout = 10; 

curl_setopt ($ch, CURLOPT_URL, $url); 

curl_setopt($ch, CURLOPT_HEADER, 1); 

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 

curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); 

$contents = curl_exec($ch); 


$lines_string=preg_replace('/href="/','href="http://192.168.43.1:8080/web.php?url=',$contents); 

echo $lines_string;

$pos = strpos($contents,'utf-8');

if($pos===false)&#123;&#36;contents = iconv("gbk","utf-8",$contents);&#125;

preg_match("/<body.*?>(.*?)<\/body>/is",$contents, $title);

$body= $title[1];

$a= preg_replace("/<sty(.*)\/style>|<scr(.*)\/script>|<!--(.*)-->/isU","",$body);

$b= strip_tags($a);

echo "<audio  autoplay='autoplay'>

  <source src='http://tts.baidu.com/text2audio?idx=1&tex=";

echo $b;

echo "&cuid=baidu_speech_demo&cod=2&lan=zh&ctp=1&pdt=1&spd=7&per=0&vol=9&pit=5' type='audio/mpeg' />";



?>

</html>


学习 / PHP  
分享:
« 上一篇下一篇 »

相关文章

MySQL使用字段名for无法写入数据  (2016-3-24 23:46:34)

用废弃的安卓手机搭建PHP网站  (2016-3-1 10:5:42)