0

0

php请求url的方法小结

小云云

小云云

发布时间:2018-05-12 11:38:17

|

5057人浏览过

|

来源于php中文网

原创

本文主要给大家介绍关于php中请求url的五种方法,分别是用fopen()函数、file()函数、file_get_contents()函数、curl() 请求远程url数据和exec() 执行命令行命令,下面来一起看看吧,希望能帮助到大家。

五种方法:

  • 前三种都是php基本的文件操作函数

  • curl()是php扩展需要开启,linux下需要安装

  • exec()执行的是linux命令行下的命令wget下载远程文件

    立即学习PHP免费学习笔记(深入)”;

其中wget命令在本地虚机测试请求http://www.php.cn/时,没有成功,在远程服务器上却可以,考虑时DNS解析的问题,于是直接请求IP成功下载了index.html的文件。

这里只提供了方法,其中的优缺点需要详细了解每一个方法的功能和缺陷。

一、fopen()函数

PHP、MySQL和Apache的学习
PHP、MySQL和Apache的学习

PHP是程式语言、MySQL是资料库,要学好任何一种都不是件容易的事,而我们,还要将它做出成果出来!很难吗?不会的!有好的方法、好的流程,其实是可以很轻松的学会,并且应用在网页上的。 书里所介绍的是观念、流程,一个步骤一个步骤依照需求,就可以做出我们要的结果,不怕做不出来,希望藉由这本书,可以让你将这些观念实现在你的网站里。 PHP & MySQL的学习,只要有正确的观念、正确

下载
$file = fopen("http://www.php.cn/", "r") or die("打开远程文件失败!");
while (!feof($file)) {
 $line = fgets($file, 1024);
 //使用正则匹配标题标记
 if (preg_match("/(.*)<\/title>/i", $line, $out)) { 
 $title = $out[1]; //将标题标记中的标题字符取出
 break; //退出循环,结束远程文件读取
 }
}
fclose($file);</pre><p>二、file()函数</p><pre class="brush:php;toolbar:false;">$lines = file("http://www.php.cn/php-weizijiaocheng-386441.html");
readfile(http://www.php.cn/php-weizijiaocheng-386441.html);</pre><p>三、file_get_contents()函数</p><pre class="brush:php;toolbar:false;">$content = file_get_contents(http://www.php.cn/php-weizijiaocheng-386441.html);</pre><p>四、curl() 请求远程url数据</p><pre class="brush:php;toolbar:false;">$url = "http://www.php.cn/";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$contents = curl_exec($ch);
curl_close($ch);</pre><p>五、exec() 执行命令行命令</p><pre class="brush:php;toolbar:false;">//exec("wget 220.181.111.188");
shell_exec("wget 220.181.111.188");</pre><p>相关推荐:<br></p>
<p><a href="http://www.php.cn/php-weizijiaocheng-374422.html" target="_self">php中请求url有哪些方法</a></p>					</div>
					<div class="artmoreart ">
													<div class="artdp artptit"><span></span>
								<p>相关文章</p>
							</div>
							<div class="artmores flexColumn">
																	<a class="artmrlis flexRow" href="/faq/1991595.html" title="标题:使用 PCRE 递归正则表达式精准匹配嵌套 [if] 模板标签"><b></b>
										<p class="overflowclass">标题:使用 PCRE 递归正则表达式精准匹配嵌套 [if] 模板标签</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1991412.html" title="如何使用 cURL 正确提交 JSON 数据到 PHP 接口"><b></b>
										<p class="overflowclass">如何使用 cURL 正确提交 JSON 数据到 PHP 接口</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1991193.html" title="如何使用 cURL 正确发送 JSON 数据到 PHP REST 接口"><b></b>
										<p class="overflowclass">如何使用 cURL 正确发送 JSON 数据到 PHP REST 接口</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1991149.html" title="php怎样定义常量_php定义常量define与const【常量】"><b></b>
										<p class="overflowclass">php怎样定义常量_php定义常量define与const【常量】</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1991136.html" title="PHP怎么注释循环体_PHP循环体注释注意【细节】"><b></b>
										<p class="overflowclass">PHP怎么注释循环体_PHP循环体注释注意【细节】</p>
									</a>
															</div>
													<div class="aritcle_card flexRow">
							<div class="artcardd flexRow">
								<a class="aritcle_card_img" href="https://pan.quark.cn/s/f79bda81fa1b" title="PHP速学教程(入门到精通)"><img
										src="https://img.php.cn/upload/Recdownload/000/000/085/666bdff371e4d231.png" alt="PHP速学教程(入门到精通)"></a>
								<div class="aritcle_card_info flexColumn">
									<a href="https://pan.quark.cn/s/f79bda81fa1b" title="PHP速学教程(入门到精通)">PHP速学教程(入门到精通)</a>
									<p>PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!</p>
								</div>
								<a href="https://pan.quark.cn/s/f79bda81fa1b" title="PHP速学教程(入门到精通)" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a>
							</div>
						</div>							<div class="artmoretabs flexRow">
								<p>相关标签:</p>
								<div class="mtbs flexRow">
									<a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15714.html" target="_blank">php</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=php" target="_blank">php</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=html" target="_blank">html</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=fopen" target="_blank">fopen</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=cURL" target="_blank">cURL</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=http" target="_blank">http</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=linux" target="_blank">linux</a>								</div>
							</div>
						
						<p class="statement">本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn</p>
						<div class="lastanext flexRow">
													<a class="lastart flexRow" href="/faq/386440.html" title="socket实现客户端和服务端通讯功能的php代码"><span>上一篇:</span>socket实现客户端和服务端通讯功能的php代码</a>
													<a class="nextart flexRow" href="/faq/386474.html" title="Laravel中间件(Middleware)的核心解读"><span>下一篇:</span>Laravel中间件(Middleware)的核心解读</a>
												</div>
					</div>

					<div class="artlef-down ">
													<div class="authormore ">
								<div class="rightdTitle flexRow">
									<div class="title-left flexRow"> <b></b>
										<p>作者最新文章</p>
									</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/382202.html" title="JS实现的ajax和同源策略详解"><b></b>
												<p class="overflowclass">JS实现的ajax和同源策略详解</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-30 11:59</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/382497.html" title="最新php程序员工具箱 v1.0版本介绍"><b></b>
												<p class="overflowclass">最新php程序员工具箱 v1.0版本介绍</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-07-11 14:50</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/384107.html" title="Vue filter介绍及其使用"><b></b>
												<p class="overflowclass">Vue filter介绍及其使用</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-30 14:37</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/384222.html" title="JS 数字和字符串之间相互转化详解"><b></b>
												<p class="overflowclass">JS 数字和字符串之间相互转化详解</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-31 09:06</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/384373.html" title="Dreamweaver网页中添加电子邮箱链接的实例分享"><b></b>
												<p class="overflowclass">Dreamweaver网页中添加电子邮箱链接的实例分享</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-30 15:06</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/384436.html" title="vue-cli 自定义指令directive 添加验证滑块详解"><b></b>
												<p class="overflowclass">vue-cli 自定义指令directive 添加验证滑块详解</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-31 10:32</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/385949.html" title="PHP之IMAP收取邮件实例详解"><b></b>
												<p class="overflowclass">PHP之IMAP收取邮件实例详解</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-31 09:37</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/387142.html" title="php基础知识笔记分享"><b></b>
												<p class="overflowclass">php基础知识笔记分享</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-30 14:28</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/387976.html" title="Redis常见的使用场景分享"><b></b>
												<p class="overflowclass">Redis常见的使用场景分享</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-31 09:31</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/388965.html" title="微信小程序文件类API详解"><b></b>
												<p class="overflowclass">微信小程序文件类API详解</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-30 14:22</p>
											</div>
										</div>
								</div>
															</div>
						
						<div class="moreAi ">
							<div class="rightdTitle flexRow">
								<div class="title-left flexRow"> <b></b>
									<p>热门AI工具</p>
								</div>
								<a target="_blank" class="rititle-more flexRow" href="/ai" title="热门AI工具"><span>更多</span><b></b></a>
							</div>

							<div class="moreailist flexRow">
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/723" title="DeepSeek" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679963982777.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="DeepSeek" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">DeepSeek</p>
												<p class="overflowclass abriptwo">幻方量化公司旗下的开源大模型平台</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/code/open-plat" title="开放平台" class="aidcontbp flexRow flexcenter">开放平台</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/726" title="豆包大模型" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175680204067325.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="豆包大模型" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">豆包大模型</p>
												<p class="overflowclass abriptwo">字节跳动自主研发的一系列大型语言模型</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/725" title="通义千问" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679974228210.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="通义千问" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">通义千问</p>
												<p class="overflowclass abriptwo">阿里巴巴推出的全能AI助手</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/854" title="腾讯元宝" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679978251103.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="腾讯元宝" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">腾讯元宝</p>
												<p class="overflowclass abriptwo">腾讯混元平台推出的AI助手</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/office/docs" title="文档处理" class="aidcontbp flexRow flexcenter">文档处理</p>
																													<p href="/ai/tag/office/excel" title="Excel 表格" class="aidcontbp flexRow flexcenter">Excel 表格</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/724" title="文心一言" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679974557049.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="文心一言" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">文心一言</p>
												<p class="overflowclass abriptwo">文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/text/chinese-writing" title="中文写作" class="aidcontbp flexRow flexcenter">中文写作</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/1507" title="讯飞写作" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/969/633/68b7a4153cd86671.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="讯飞写作" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">讯飞写作</p>
												<p class="overflowclass abriptwo">基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/text/chinese-writing" title="中文写作" class="aidcontbp flexRow flexcenter">中文写作</p>
																													<p href="/ai/tag/text/write" title="写作工具" class="aidcontbp flexRow flexcenter">写作工具</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/1115" title="即梦AI" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/001/246/273/68b6d8f7c530c315.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="即梦AI" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">即梦AI</p>
												<p class="overflowclass abriptwo">一站式AI创作平台,免费AI图片和视频生成。</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/image/image-titching" title="图片拼接" class="aidcontbp flexRow flexcenter">图片拼接</p>
																													<p href="/ai/tag/image/image-create" title="图画生成" class="aidcontbp flexRow flexcenter">图画生成</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/808" title="ChatGPT" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679970194596.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="ChatGPT" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">ChatGPT</p>
												<p class="overflowclass abriptwo">最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/text/chinese-writing" title="中文写作" class="aidcontbp flexRow flexcenter">中文写作</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/821" title="智谱清言 - 免费全能的AI助手" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679976181507.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="智谱清言 - 免费全能的AI助手" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">智谱清言 - 免费全能的AI助手</p>
												<p class="overflowclass abriptwo">智谱清言 - 免费全能的AI助手</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/office/pdf" title="PDF 文档" class="aidcontbp flexRow flexcenter">PDF 文档</p>
																											</div>
																							</div>
										</a>
									</div>
															</div>




						</div>

					</div>


				</div>


			</div>
			<div class="conRight artdtilRight ">
				<div class="artrig-adv ">
                    <script type="text/javascript" src="https://teacher.php.cn/php/MDM3MTk1MGYxYjI5ODJmNTE0ZWVkZTA3NmJhYzhmMjI6Og=="></script>
                </div>
				<div class="hotzt artdtzt">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>相关专题</p>
						</div>
						<a target="_blank" class="rititle-more flexRow" href="/faq/zt" title="相关专题"><span>更多</span><b></b></a>
					</div>
					<div class="hotztuls flexColumn">
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/phpwjzmdk" class="aClass flexRow hotzta" title="php文件怎么打开"><img
										src="https://img.php.cn/upload/subject/202309/01/2023090111533461500.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="php文件怎么打开" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/phpwjzmdk" class="aClass flexRow hotztra overflowclass" title="php文件怎么打开">php文件怎么打开</a>
									<p class="aClass flexRow hotztrp overflowclass">打开php文件步骤:1、选择文本编辑器;2、在选择的文本编辑器中,创建一个新的文件,并将其保存为.php文件;3、在创建的PHP文件中,编写PHP代码;4、要在本地计算机上运行PHP文件,需要设置一个服务器环境;5、安装服务器环境后,需要将PHP文件放入服务器目录中;6、一旦将PHP文件放入服务器目录中,就可以通过浏览器来运行它。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">2593</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.09.01</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/phpzmqcszys" class="aClass flexRow hotzta" title="php怎么取出数组的前几个元素"><img
										src="https://img.php.cn/upload/subject/202310/11/2023101111394597302.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="php怎么取出数组的前几个元素" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/phpzmqcszys" class="aClass flexRow hotztra overflowclass" title="php怎么取出数组的前几个元素">php怎么取出数组的前几个元素</a>
									<p class="aClass flexRow hotztrp overflowclass">取出php数组的前几个元素的方法有使用array_slice()函数、使用array_splice()函数、使用循环遍历、使用array_slice()函数和array_values()函数等。本专题为大家提供php数组相关的文章、下载、课程内容,供大家免费下载体验。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">1620</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.10.11</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/phpfxlsb" class="aClass flexRow hotzta" title="php反序列化失败怎么办"><img
										src="https://img.php.cn/upload/subject/202310/11/2023101111442515737.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="php反序列化失败怎么办" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/phpfxlsb" class="aClass flexRow hotztra overflowclass" title="php反序列化失败怎么办">php反序列化失败怎么办</a>
									<p class="aClass flexRow hotztrp overflowclass">php反序列化失败的解决办法检查序列化数据。检查类定义、检查错误日志、更新PHP版本和应用安全措施等。本专题为大家提供php反序列化相关的文章、下载、课程内容,供大家免费下载体验。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">1508</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.10.11</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/phpljmssql" class="aClass flexRow hotzta" title="php怎么连接mssql数据库"><img
										src="https://img.php.cn/upload/subject/202310/23/2023102311474720631.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="php怎么连接mssql数据库" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/phpljmssql" class="aClass flexRow hotztra overflowclass" title="php怎么连接mssql数据库">php怎么连接mssql数据库</a>
									<p class="aClass flexRow hotztrp overflowclass">连接方法:1、通过mssql_系列函数;2、通过sqlsrv_系列函数;3、通过odbc方式连接;4、通过PDO方式;5、通过COM方式连接。想了解php怎么连接mssql数据库的详细内容,可以访问下面的文章。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">952</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.10.23</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/phpljmssqlsjk" class="aClass flexRow hotzta" title="php连接mssql数据库的方法"><img
										src="https://img.php.cn/upload/subject/202310/23/2023102312044461242.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="php连接mssql数据库的方法" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/phpljmssqlsjk" class="aClass flexRow hotztra overflowclass" title="php连接mssql数据库的方法">php连接mssql数据库的方法</a>
									<p class="aClass flexRow hotztrp overflowclass">php连接mssql数据库的方法有使用PHP的MSSQL扩展、使用PDO等。想了解更多php连接mssql数据库相关内容,可以阅读本专题下面的文章。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">1417</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.10.23</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/htmlzmsc" class="aClass flexRow hotzta" title="html怎么上传"><img
										src="https://img.php.cn/upload/subject/202311/03/2023110309571979057.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="html怎么上传" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/htmlzmsc" class="aClass flexRow hotztra overflowclass" title="html怎么上传">html怎么上传</a>
									<p class="aClass flexRow hotztrp overflowclass">html通过使用HTML表单、JavaScript和PHP上传。更多关于html的问题详细请看本专题下面的文章。php中文网欢迎大家前来学习。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">1234</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.11.03</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/phpcxlmzmjj" class="aClass flexRow hotzta" title="PHP出现乱码怎么解决"><img
										src="https://img.php.cn/upload/subject/202311/09/2023110909430246458.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="PHP出现乱码怎么解决" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/phpcxlmzmjj" class="aClass flexRow hotztra overflowclass" title="PHP出现乱码怎么解决">PHP出现乱码怎么解决</a>
									<p class="aClass flexRow hotztrp overflowclass">PHP出现乱码可以通过修改PHP文件头部的字符编码设置、检查PHP文件的编码格式、检查数据库连接设置和检查HTML页面的字符编码设置来解决。更多关于php乱码的问题详情请看本专题下面的文章。php中文网欢迎大家前来学习。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">1447</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.11.09</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/phpwjzmzsjsdk" class="aClass flexRow hotzta" title="php文件怎么在手机上打开"><img
										src="https://img.php.cn/upload/subject/202311/13/2023111311092751784.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="php文件怎么在手机上打开" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/phpwjzmzsjsdk" class="aClass flexRow hotztra overflowclass" title="php文件怎么在手机上打开">php文件怎么在手机上打开</a>
									<p class="aClass flexRow hotztrp overflowclass">php文件在手机上打开需要在手机上搭建一个能够运行php的服务器环境,并将php文件上传到服务器上。再在手机上的浏览器中输入服务器的IP地址或域名,加上php文件的路径,即可打开php文件并查看其内容。更多关于php相关问题,详情请看本专题下面的文章。php中文网欢迎大家前来学习。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">1306</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2023.11.13</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/gddtsjffhz" class="aClass flexRow hotzta" title="高德地图升级方法汇总"><img
										src="https://img.php.cn/upload/subject/202601/16/2026011616530741625.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="高德地图升级方法汇总" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/gddtsjffhz" class="aClass flexRow hotztra overflowclass" title="高德地图升级方法汇总">高德地图升级方法汇总</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了高德地图升级相关教程,阅读专题下面的文章了解更多详细内容。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">9</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.16</p>
										</div>
									</div>
								</div>
							</div>
											</div>
				</div>

				<div class="hotdownload ">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>热门下载</p>
						</div>
						<a target="_blank" class="rititle-more flexRow" href="/xiazai" title="热门下载"><span>更多</span><b></b></a>
					</div>
					<div class="hotdownTab">
						<div class="hdTabs flexRow">
							<div class="check" data-id="onef">网站特效 <b></b> </div> /
							<div class="" data-id="twof">网站源码 <b></b></div> /
							<div class="" data-id="threef">网站素材 <b></b></div> /
							<div class="" data-id="fourf">前端模板 <b></b></div>
						</div>
						<ul class="onef">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery添加删除表单元素代码" href="/xiazai/js/8487"><span>[表单按钮]</span><span>jQuery添加删除表单元素代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="一串文字跳动css3动画特效" href="/xiazai/js/8486"><span>[文字特效]</span><span>一串文字跳动css3动画特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery按钮控制图片左右滚动代码" href="/xiazai/js/8485"><span>[图片特效]</span><span>jQuery按钮控制图片左右滚动代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery手机端左右滑动切换表单代码" href="/xiazai/js/8484"><span>[表单按钮]</span><span>jQuery手机端左右滑动切换表单代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jquery鼠标滑动按钮图片切换" href="/xiazai/js/8483"><span>[图片特效]</span><span>jquery鼠标滑动按钮图片切换</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery拖动设置时间段表单提交" href="/xiazai/js/8482"><span>[表单按钮]</span><span>jQuery拖动设置时间段表单提交</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jquery折纸变换效果" href="/xiazai/js/8481"><span>[图片特效]</span><span>jquery折纸变换效果</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="炫酷文字抖动动画网页特效" href="/xiazai/js/8480"><span>[文字特效]</span><span>炫酷文字抖动动画网页特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="HTML5 SVG动态图片文字特效" href="/xiazai/js/8479"><span>[文字特效]</span><span>HTML5 SVG动态图片文字特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="js+html5实现图片倒影效果代码" href="/xiazai/js/8478"><span>[图片特效]</span><span>js+html5实现图片倒影效果代码</span></a>
									</div>
								</li>
													</ul>
						<ul class="twof" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11354" title="思翔企(事)业单位文件柜 build 20080313"><span>[其它模板]</span><span>思翔企(事)业单位文件柜 build 20080313</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11353" title="雅龙智能装备工业设备类WordPress主题1.0"><span>[企业站源码]</span><span>雅龙智能装备工业设备类WordPress主题1.0</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11352" title="威发卡自动发卡系统"><span>[电商源码]</span><span>威发卡自动发卡系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11351" title="卡密分发系统"><span>[电商源码]</span><span>卡密分发系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11350" title="中华陶瓷网"><span>[电商源码]</span><span>中华陶瓷网</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11349" title="简洁粉色食品公司网站"><span>[电商源码]</span><span>简洁粉色食品公司网站</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11348" title="极速网店系统"><span>[电商源码]</span><span>极速网店系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11347" title="淘宝妈妈_淘客推广系统"><span>[电商源码]</span><span>淘宝妈妈_淘客推广系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11346" title="积客B2SCMS商城系统"><span>[电商源码]</span><span>积客B2SCMS商城系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11345" title="CODEC2I 众筹系统"><span>[电商源码]</span><span>CODEC2I 众筹系统</span> </a>
									</div>
								</li>
													</ul>
						<ul class="threef" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4201" title="扁平海边沙滩旅游风景矢量插画"><span>[网站素材]</span><span>扁平海边沙滩旅游风景矢量插画</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4200" title="超市购物特价产品宣传主图PSD素材下载"><span>[网站素材]</span><span>超市购物特价产品宣传主图PSD素材下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4199" title="现代几何抽象飞鸟装饰矢量素材"><span>[网站素材]</span><span>现代几何抽象飞鸟装饰矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4198" title="极简线条玉兰花卉插画矢量素材"><span>[网站素材]</span><span>极简线条玉兰花卉插画矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4197" title="手绘烹饪调料香料合集矢量素材"><span>[网站素材]</span><span>手绘烹饪调料香料合集矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4196" title="惬意午后咖啡阅读时光矢量插画"><span>[网站素材]</span><span>惬意午后咖啡阅读时光矢量插画</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4195" title="中国宏伟古建筑矢量素材"><span>[网站素材]</span><span>中国宏伟古建筑矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4194" title="黑色星期五耳机折扣横幅设计下载"><span>[网站素材]</span><span>黑色星期五耳机折扣横幅设计下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4193" title="国潮风莲花荷塘插画矢量素材"><span>[网站素材]</span><span>国潮风莲花荷塘插画矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4192" title="假日快乐烟花背景ps素材下载"><span>[网站素材]</span><span>假日快乐烟花背景ps素材下载</span> </a>
									</div>
								</li>
													</ul>
						<ul class="fourf" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8590"  title="驾照考试驾校HTML5网站模板"><span>[前端模板]</span><span>驾照考试驾校HTML5网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8589"  title="驾照培训服务机构宣传网站模板"><span>[前端模板]</span><span>驾照培训服务机构宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8588"  title="HTML5房地产公司宣传网站模板"><span>[前端模板]</span><span>HTML5房地产公司宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8587"  title="新鲜有机肉类宣传网站模板"><span>[前端模板]</span><span>新鲜有机肉类宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8586"  title="响应式天气预报宣传网站模板"><span>[前端模板]</span><span>响应式天气预报宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8585"  title="房屋建筑维修公司网站CSS模板"><span>[前端模板]</span><span>房屋建筑维修公司网站CSS模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8584"  title="响应式志愿者服务网站模板"><span>[前端模板]</span><span>响应式志愿者服务网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8583"  title="创意T恤打印店网站HTML5模板"><span>[前端模板]</span><span>创意T恤打印店网站HTML5模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8582"  title="网页开发岗位简历作品展示网页模板"><span>[前端模板]</span><span>网页开发岗位简历作品展示网页模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8581"  title="响应式人力资源机构宣传网站模板"><span>[前端模板]</span><span>响应式人力资源机构宣传网站模板</span> </a>
									</div>
								</li>
													</ul>
					</div>
					<script>
						$('.hdTabs>div').click(function (e) {
							$('.hdTabs>div').removeClass('check')
							$(this).addClass('check')
							$('.hotdownTab>ul').css('display', 'none')
							$('.' + e.currentTarget.dataset.id).show()
						})
					</script>

				</div>

				<div class="artrig-adv ">
					<script type="text/javascript" src="https://teacher.php.cn/php/MDM3MTk1MGYxYjI5ODJmNTE0ZWVkZTA3NmJhYzhmMjI6Og=="></script>
                </div>



				<div class="xgarts ">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>相关下载</p>
						</div>
						<a target="_blank" class="rititle-more flexRow" href="/xiazai" title="相关下载"><span>更多</span><b></b></a>
					</div>
					<div class="xgwzlist ">
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP、MySQL和Apache的学习" href="/xiazai/learn/2633">PHP、MySQL和Apache的学习</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="直观的QuickPro指南第2版" href="/xiazai/learn/2632">直观的QuickPro指南第2版</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="初阶PHPApache.MySQL网站设计" href="/xiazai/learn/2631">初阶PHPApache.MySQL网站设计</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="VTC PHP 教程" href="/xiazai/learn/2630">VTC PHP 教程</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="php图片处理函数" href="/xiazai/learn/2629">php图片处理函数</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP高级开发技巧与范例(PDG)" href="/xiazai/learn/2628">PHP高级开发技巧与范例(PDG)</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP程序之服务器负载测试" href="/xiazai/learn/2627">PHP程序之服务器负载测试</a></div>
										</div>

				</div>

				<div class="jpkc">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>精品课程</p>
						</div>
						<a class="rititle-more flexRow" target="_blank" href="/course/sort_new.html" title="精品课程"><span>更多</span><b></b></a>
					</div>
					<div class=" jpkcTab">
						<div class=" jpkcTabs flexRow">
							<div class="check" data-id="onefd">相关推荐 <b></b> </div> /
							<div class="" data-id="twofd">热门推荐 <b></b></div> /
							<div class="" data-id="threefd">最新课程 <b></b></div>
						</div>
						<div class="onefd jpktabd">
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1665.html" title="PHP课程">
									<img src="https://img.php.cn/upload/course/000/000/090/6892cfe1adf0c212.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="PHP课程" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1665.html" title="PHP课程"
										class="rirightp overflowclass">PHP课程</a>

									<div class="risrdown flexRow">
										<p>共137课时 | 8.7万人学习</p>
									</div>
								</div>
							</div>
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学">
									<img src="https://img.php.cn/upload/course/000/000/081/6862652adafef801.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="JavaScript ES5基础线上课程教学" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学"
										class="rirightp overflowclass">JavaScript ES5基础线上课程教学</a>

									<div class="risrdown flexRow">
										<p>共6课时 | 7.3万人学习</p>
									</div>
								</div>
							</div>
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1655.html" title="PHP新手语法线上课程教学">
									<img src="https://img.php.cn/upload/course/000/000/081/684a8c23d811b293.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="PHP新手语法线上课程教学" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1655.html" title="PHP新手语法线上课程教学"
										class="rirightp overflowclass">PHP新手语法线上课程教学</a>

									<div class="risrdown flexRow">
										<p>共13课时 | 0.9万人学习</p>
									</div>
								</div>
							</div>
												</div>

						<div class="twofd jpktabd" style="display:none;">
															<div  class="ristyA flexRow " >
									<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学">
										<img src="https://img.php.cn/upload/course/000/000/081/6862652adafef801.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="JavaScript ES5基础线上课程教学" class="ristyAimg"
											onerror="this.src='/static/mobimages/moren/morentu.png'">
									</a>
									<div class="ristyaRight flexColumn">
										<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学"
											class="rirightp overflowclass">JavaScript ES5基础线上课程教学</a>

										<div class="risrdown flexRow">
											<p>共6课时 | 7.3万人学习</p>
										</div>
									</div>
								</div>
															<div  class="ristyA flexRow " >
									<a target="_blank" href="/course/812.html" title="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)">
										<img src="https://img.php.cn/upload/course/000/000/041/620debc3eab3f377.jpg?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)" class="ristyAimg"
											onerror="this.src='/static/mobimages/moren/morentu.png'">
									</a>
									<div class="ristyaRight flexColumn">
										<a target="_blank" href="/course/812.html" title="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)"
											class="rirightp overflowclass">最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)</a>

										<div class="risrdown flexRow">
											<p>共79课时 | 151.2万人学习</p>
										</div>
									</div>
								</div>
															<div  class="ristyA flexRow " >
									<a target="_blank" href="/course/639.html" title="phpStudy极速入门视频教程">
										<img src="https://img.php.cn/upload/course/000/000/068/62611ef88fcec821.jpg?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="phpStudy极速入门视频教程" class="ristyAimg"
											onerror="this.src='/static/mobimages/moren/morentu.png'">
									</a>
									<div class="ristyaRight flexColumn">
										<a target="_blank" href="/course/639.html" title="phpStudy极速入门视频教程"
											class="rirightp overflowclass">phpStudy极速入门视频教程</a>

										<div class="risrdown flexRow">
											<p>共6课时 | 53.4万人学习</p>
										</div>
									</div>
								</div>
													</div>

						<div class="threefd jpktabd" style="display:none;">
															<div  class="ristyA flexRow " >
										<a target="_blank" href="/course/1696.html" title="最新Python教程 从入门到精通">
											<img src="https://img.php.cn/upload/course/000/000/081/68c135bb72783194.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="最新Python教程 从入门到精通" class="ristyAimg"
												onerror="this.src='/static/mobimages/moren/morentu.png'">
										</a>
										<div class="ristyaRight flexColumn">
											<a target="_blank" href="/course/1696.html" title="最新Python教程 从入门到精通"
												class="rirightp overflowclass">最新Python教程 从入门到精通</a>

											<div class="risrdown flexRow">
												<p>共4课时 | 1.6万人学习</p>
											</div>
										</div>
									</div>
																<div  class="ristyA flexRow " >
										<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学">
											<img src="https://img.php.cn/upload/course/000/000/081/6862652adafef801.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="JavaScript ES5基础线上课程教学" class="ristyAimg"
												onerror="this.src='/static/mobimages/moren/morentu.png'">
										</a>
										<div class="ristyaRight flexColumn">
											<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学"
												class="rirightp overflowclass">JavaScript ES5基础线上课程教学</a>

											<div class="risrdown flexRow">
												<p>共6课时 | 7.3万人学习</p>
											</div>
										</div>
									</div>
																<div  class="ristyA flexRow " >
										<a target="_blank" href="/course/1655.html" title="PHP新手语法线上课程教学">
											<img src="https://img.php.cn/upload/course/000/000/081/684a8c23d811b293.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="PHP新手语法线上课程教学" class="ristyAimg"
												onerror="this.src='/static/mobimages/moren/morentu.png'">
										</a>
										<div class="ristyaRight flexColumn">
											<a target="_blank" href="/course/1655.html" title="PHP新手语法线上课程教学"
												class="rirightp overflowclass">PHP新手语法线上课程教学</a>

											<div class="risrdown flexRow">
												<p>共13课时 | 0.9万人学习</p>
											</div>
										</div>
									</div>
														</div>
						<script>
							$('.jpkcTabs>div').click(function (e) {
								$('.jpkcTabs>div').removeClass('check')
								$(this).addClass('check')
								$('.jpkcTab .jpktabd').css('display', 'none')
								$('.' + e.currentTarget.dataset.id).show()
							})
						</script>

					</div>
				</div>

				<div class="zxarts ">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>最新文章</p>
						</div>
						<a class="rititle-more flexRow" href="" title="最新文章" target="_blank"><span>更多</span><b></b></a>
					</div>
					<div class="xgwzlist ">
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP怎样添加空间索引_PHP空间索引建表法【地理】" href="/faq/1991871.html">PHP怎样添加空间索引_PHP空间索引建表法【地理】</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP探针怎么修复乱码问题_PHP探针修复乱码方法【操作】" href="/faq/1991781.html">PHP探针怎么修复乱码问题_PHP探针修复乱码方法【操作】</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何正确计算嵌套 PHP 数组中每个客户订单数量的总和" href="/faq/1991682.html">如何正确计算嵌套 PHP 数组中每个客户订单数量的总和</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何使用 cURL 正确发送 JSON 数据到 PHP 接口" href="/faq/1991678.html">如何使用 cURL 正确发送 JSON 数据到 PHP 接口</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何在 PHP 中安全高效地批量更新数据库记录" href="/faq/1991638.html">如何在 PHP 中安全高效地批量更新数据库记录</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="标题:使用 PCRE 递归正则表达式精准匹配嵌套 [if] 模板标签" href="/faq/1991595.html">标题:使用 PCRE 递归正则表达式精准匹配嵌套 [if] 模板标签</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何安全移除 Elementor 生成的 HTML 标签并保留内部文本内容" href="/faq/1991536.html">如何安全移除 Elementor 生成的 HTML 标签并保留内部文本内容</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何安全移除 Elementor 生成的 HTML 标签,仅保留内部文本内容" href="/faq/1991491.html">如何安全移除 Elementor 生成的 HTML 标签,仅保留内部文本内容</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何使用 cURL 正确提交 JSON 数据到 PHP 接口" href="/faq/1991412.html">如何使用 cURL 正确提交 JSON 数据到 PHP 接口</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何生成不与数据库中已存密码哈希冲突的随机5位数字密码" href="/faq/1991400.html">如何生成不与数据库中已存密码哈希冲突的随机5位数字密码</a></div>
											</div>

				</div>






			</div>



		</div>

	</div>
	<!--底部-->
	<div class="phpFoot">
    <div class="phpFootIn">
        <div class="phpFootCont">
            <div class="phpFootLeft">
                <dl>
                    <dt>
                        <a target="_blank"  href="/about/us.html" rel="nofollow"  title="关于我们" class="cBlack">关于我们</a>
                        <a target="_blank"  href="/about/disclaimer.html" rel="nofollow"  title="免责申明" class="cBlack">免责申明</a>
                        <a target="_blank"  href="/about/jbzx.html" rel="nofollow"  title="举报中心" class="cBlack">举报中心</a>
                        <a   href="javascript:;" rel="nofollow" onclick="advice_data(99999999,'意见反馈')"   title="意见反馈" class="cBlack">意见反馈</a>
                        <a target="_blank"  href="https://www.php.cn/teacher.html" rel="nofollow"   title="讲师合作" class="cBlack">讲师合作</a>
                        <a  target="_blank" href="https://www.php.cn/blog/detail/20304.html" rel="nofollow"  title="广告合作" class="cBlack">广告合作</a>
                        <a  target="_blank" href="/new/"    title="最新文章列表" class="cBlack">最新更新</a>
                                                <div class="clear"></div>
                    </dt>
                    <dd class="cont1">php中文网:公益在线php培训,帮助PHP学习者快速成长!</dd>
                    <dd class="cont2">
                      <span class="ylwTopBox">
                        <a   href="javascript:;"  class="cBlack"><b class="icon1"></b>关注服务号</a>
                        <em style="display:none;" class="ylwTopSub">
                          <p>微信扫码<br/>关注PHP中文网服务号</p>
                          <img src="/static/images/examples/text16.png"/>
                        </em>
                      </span>
                        <span class="ylwTopBox">
                        <a   href="tencent://message/?uin=27220243&Site=www.php.cn&Menu=yes"  class="cBlack"><b class="icon2"></b>技术交流群</a>
                        <em style="display:none;" class="ylwTopSub">
                          <p>QQ扫码<br/>加入技术交流群</p>
                          <img src="/static/images/examples/text18.png"/>
                        </em>
                      </span>
                        <div class="clear"></div>
                    </dd>
                </dl>
                
            </div>
            <div class="phpFootRight">
                <div class="phpFootMsg">
                    <span><img src="/static/images/examples/text17.png"/></span>
                    <dl>
                        <dt>PHP中文网订阅号</dt>
                        <dd>每天精选资源文章推送</dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="phpFootCode">
        <div class="phpFootCodeIn"><p>Copyright 2014-2026 <a   href="https://www.php.cn/" >https://www.php.cn/</a> All Rights Reserved | php.cn | <a   href="https://beian.miit.gov.cn/" rel="nofollow" >湘ICP备2023035733号</a></p><a   href="http://www.beian.gov.cn/portal/index.do" rel="nofollow" ><b></b></a></div>
    </div>
</div>
<input type="hidden" id="verifycode" value="/captcha.html">
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c0e685c8743351838d2a7db1c49abd56";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
<script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script>

<span class="layui-hide"><script type="text/javascript" src="https://s4.cnzz.com/z_stat.php?id=1280886301&web_id=1280886301"></script></span>

<script src="/static/js/cdn.js?v=1.0.1"></script>



	<!--底部 end-->
	<!-- content -->
	<!--
    <div class="phpFudong">
        <div class="phpFudongIn">
            <div class="phpFudongImg"></div>
            <div class="phpFudongXue">登录PHP中文网,和优秀的人一起学习!</div>
            <div class="phpFudongQuan">全站<span>2000+</span>教程免费学</div>
            <div class="phpFudongCode"><a   href="javascript:;" id="login" title="微信扫码登录">微信扫码登录</a></div>
            <div class="phpGuanbi" onclick="$('.phpFudong').hide();"></div>
            <div class="clear"></div>
        </div>
    </div>
-->	<!--底部浮动层 end-->
	<!--侧导航-->
	<style>
    .layui-fixbar{display: none;}
</style>
<div class="phpSdhBox" style="height:240px !important;">
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a   href="/k24.html"  class="hover" title="PHP学习">
                    <b class="icon1"></b>
                    <p>PHP学习</p>
                </a>
            </div>
        </div>
    </li>
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a   href="https://www.php.cn/blog/detail/1047189.html" >
                    <b class="icon2"></b>
                    <p>技术支持</p>
                </a>
            </div>
        </div>
    </li>
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a   href="#">
                    <b class="icon6"></b>
                    <p>返回顶部</p>
                </a>
            </div>
        </div>
    </li>
</div>
	</body>

</html>

<script type="text/javascript" src="/hitsUp?type=article&id=386441&time=1768607002">
</script>
<script src="/static/ueditor/third-party/SyntaxHighlighter/shCore.js?1768607002"></script>
<script>
	article_status = "54025";
</script>
<input type="hidden" id="verifycode" value="/captcha.html">
<script type="text/javascript" src="/static/js/global.min.js?5.5.33"></script>
<link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' />
<script type='text/javascript' src='/static/js/viewer.min.js?1'></script>
<script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script>var _hmt = _hmt || [];(function(){var hm = document.createElement("script");hm.src="//hm.baidu.com/hm.js?c0e685c8743351838d2a7db1c49abd56";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();(function(){var bp = document.createElement('script');var curProtocol = window.location.protocol.split(':')[0];if(curProtocol === 'https'){bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';}else{bp.src = 'http://push.zhanzhang.baidu.com/push.js';};var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(bp, s);})();</script>
	

<script>
	function setCookie(name, value, iDay) { //name相当于键,value相当于值,iDay为要设置的过期时间(天)
		var oDate = new Date();
		oDate.setDate(oDate.getDate() + iDay);
		document.cookie = name + '=' + value + ';path=/;domain=.php.cn;expires=' + oDate;
	}

	function getCookie(name) {
		var cookieArr = document.cookie.split(";");
		for (var i = 0; i < cookieArr.length; i++) {
			var cookiePair = cookieArr[i].split("=");
			if (name == cookiePair[0].trim()) {
				return decodeURIComponent(cookiePair[1]);
			}
		}
		return null;
	}
</script>


<!-- Matomo -->
<script>
	var _paq = window._paq = window._paq || [];
	/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
	_paq.push(['trackPageView']);
	_paq.push(['enableLinkTracking']);
	(function () {
		var u = "https://tongji.php.cn/";
		_paq.push(['setTrackerUrl', u + 'matomo.php']);
		_paq.push(['setSiteId', '11']);
		var d = document,
			g = d.createElement('script'),
			s = d.getElementsByTagName('script')[0];
		g.async = true;
		g.src = u + 'matomo.js';
		s.parentNode.insertBefore(g, s);
	})();
</script>
<!-- End Matomo Code -->

<script>
	setCookie('is_article', 1, 1);
</script>

<script>
	var is_login = "0";
        var show = 0;
        var ceng = getCookie('ceng');
        //未登录复制显示登录按钮
        if(is_login == 0 && false){
            $(".code").hover(function(){
                $(this).find('.contentsignin').show();
            },function(){
                $(this).find('.contentsignin').hide();
            });
            //不给复制
            $('.code').bind("cut copy paste",function(e) {
                e.preventDefault();
            });
            $('.code .contentsignin').click(function(){
                $(document).trigger("api.loginpopbox");
            })
        }else{
            // 获取所有的 <pre> 元素
            var preElements = document.querySelectorAll('pre');
            preElements.forEach(function(preElement) {
                // 创建复制按钮
                var copyButton = document.createElement('button');
                copyButton.className = 'copy-button';
                copyButton.textContent = '复制';
                // 添加点击事件处理程序
                copyButton.addEventListener('click', function() {
                    // 获取当前按钮所属的 <pre> 元素中的文本内容
                    var textContent = preElement.textContent.trim();
                    // 创建一个临时 textarea 元素并设置其值为 <pre> 中的文本内容
                    var tempTextarea = document.createElement('textarea');
                    tempTextarea.value = textContent;
                    // 将临时 textarea 添加到文档中
                    document.body.appendChild(tempTextarea);
                    // 选中临时 textarea 中的文本内容并执行复制操作
                    tempTextarea.select();
                    document.execCommand('copy');
                    // 移除临时 textarea 元素
                    document.body.removeChild(tempTextarea);
                    // 更新按钮文本为 "已复制"
                    this.textContent = '已复制';
                });

                // 创建AI写代码按钮
                var aiButton = document.createElement('button');
                aiButton.className = 'copy-button';
                aiButton.textContent = 'AI写代码';
                aiButton.style.marginLeft = '5px';
                aiButton.style.marginRight = '5px';
                // 添加点击事件处理程序
                aiButton.addEventListener('click', function() {
                // Generate a random number between 0 and 1
                        var randomChance = Math.random();

                    // If the random number is less than 0.5, open the first URL, else open the second
                    if (randomChance < 0.5) {
                        window.open('https://www.doubao.com/chat/coding?channel=php&source=hw_db_php', '_blank');
                    } else {
                        window.open('https://click.aliyun.com/m/1000402709/', '_blank');
                    }
                });

                // 将按钮添加到 <pre> 元素前面
                preElement.parentNode.insertBefore(copyButton, preElement);
                preElement.parentNode.insertBefore(aiButton, preElement);
        });
        }
</script>