0

0

webapi中如何使用依赖注入

高洛峰

高洛峰

发布时间:2017-02-10 17:26:27

|

2312人浏览过

|

来源于php中文网

原创

本篇将要和大家分享的是webapi中如何使用依赖注入,依赖注入这个东西在接口中常用,实际工作中也用的比较频繁,因此这里分享两种在api中依赖注入的方式ninject和unity。下面跟着小编一起来看下吧

本篇将要和大家分享的是webapi中如何使用依赖注入,依赖注入这个东西在接口中常用,实际工作中也用的比较频繁,因此这里分享两种在api中依赖注入的方式Ninject和Unity;由于快过年这段时间打算了解下vue.js,所以后面对webapi的分享文章可能会慢点更新,希望支持的朋友们多多谅解,毕竟只有不断充电学习,才能更好的适应it行业吧;本章内容希望大家喜欢,也希望各位多多扫码支持和推荐谢谢:

» Task并行任务抓取博客园首页信息

» IOC框架Ninject的使用

» IOC框架Unity的使用

下面一步一个脚印的来分享:

» Task并行任务抓取博客园首页信息

首先,咋们需要创建一个博客信息实体类 MoBlog ,实体类代码如下:

public class MoBlog
 {
  public MoBlog() { }
  /// 
  /// 作者昵称
  /// 
  public string NickName { get; set; }
  /// 
  /// 标题
  /// 
  public string Title { get; set; }
  /// 
  ///该篇文字地址
  /// 
  public string Url { get; set; }
  /// 
  /// 描述
  /// 
  public string Des { get; set; }
  /// 
  /// 头像图片地址
  /// 
  public string HeadUrl { get; set; }
  /// 
  /// 博客地址
  /// 
  public string BlogUrl { get; set; }
  /// 
  /// 点赞次数
  /// 
  public int ZanNum { get; set; }
  /// 
  /// 阅读次数
  /// 
  public int ReadNum { get; set; }
  /// 
  /// 评论次数
  /// 
  public int CommiteNum { get; set; }
  /// 
  /// 创建时间
  /// 
  public DateTime CreateTime { get; set; }
 }

然后,需要创建一个接口 IBlogsReposity ,并且定义一个如下代码的方法:

public interface IBlogsReposity
 {
  /// 
  /// 获取博客信息
  /// 
  /// 
  /// 
  Task> GetBlogs(int nTask);
 }

注意这里定义的返回类型是Task,主要作用是async异步返回博客信息,并且方便使用并行方式抓取不同页数的数据,因此这里传递了一个int类型的参数nTask(表示任务数量);好了咋们来一起看下具体实现接口的 BoKeYuan 类里面的代码:

public class BoKeYuan : IBlogsReposity
 {
  public async Task> GetBlogs(int nTask)
  {
   var blogs = new List();
   try
   {
    //开启nTask个任务,读取前nTask页信息
    Task>[] tasks = new Task>[nTask];
    for (int i = 1; i <= tasks.Length; i++)
    {
     tasks[i - 1] = await Task.Factory.StartNew>>((page) =>
      {
       return GetBlogsByPage(Convert.ToInt32(page));
      }, i);
    }
    //30s等待
    Task.WaitAll(tasks, TimeSpan.FromSeconds(30));
    foreach (var item in tasks.Where(b => b.IsCompleted))
    {
     blogs.AddRange(item.Result);
    }
   }
   catch (Exception ex)
   {
   }
   return blogs.OrderByDescending(b => b.CreateTime);
  }
  /// 
  /// 
  /// 
  /// 页数
  /// 
  async Task> GetBlogsByPage(int nPage)
  {
   var blogs = new List();
   try
   {
    var strBlogs = string.Empty;
    using (HttpClient client = new HttpClient())
    {
     strBlogs = await client.GetStringAsync("http://www.cnblogs.com/sitehome/p/" + nPage);
    }
    if (string.IsNullOrWhiteSpace(strBlogs)) { return blogs; }
    var matches = Regex.Matches(strBlogs, "diggnum\"[^>]+>(?\\d+)[^:]+(?http[^\"]+)[^>]+>(?[^<]+)<\\/a>[^=]+=[^=]+=\"(?<hurl>http://(\\w|\\.|\\/)+)[^>]+>[^\\/]+\\/\\/(?<hphoto>[^\"]+)[^<]+<\\/a>(?<bdes>[^<]+)[^\"]+[^=]+=[^>]+>(?<hname>[^<]+)[^2]+(?<bcreatetime>[^<]+)[^\\(]+\\((?<bcomment>\\d+)[^\\(]+\\((?<bread>\\d+)");
    if (matches.Count <= 0) { return blogs; }
    foreach (Match item in matches)
    {
     blogs.Add(new MoBlog
     {
      Title = item.Groups["title"].Value.Trim(),
      NickName = item.Groups["hname"].Value.Trim(),
      Des = item.Groups["bdes"].Value.Trim(),
      ZanNum = Convert.ToInt32(item.Groups["hzan"].Value.Trim()),
      ReadNum = Convert.ToInt32(item.Groups["bread"].Value.Trim()),
      CommiteNum = Convert.ToInt32(item.Groups["bcomment"].Value.Trim()),
      CreateTime = Convert.ToDateTime(item.Groups["bcreatetime"].Value.Trim()),
      HeadUrl = "http://" + item.Groups["hphoto"].Value.Trim(),
      BlogUrl = item.Groups["hurl"].Value.Trim(),
      Url = item.Groups["burl"].Value.Trim(),
     });
    }
   }
   catch (Exception ex)
   {
   }
   return blogs;
  }
 }</pre><p></p>
<p>代码分析:</p>
<p>1. Task<ienumerable>>[] tasks = new Task<ienumerable>>[nTask]作为并行任务的容器;</ienumerable></ienumerable></p>
<p>2. Task.Factory.StartNew创建对应的任务</p>
<p>3. Task.WaitAll(tasks, TimeSpan.FromSeconds(30));等待容器里面任务完成30秒后超时</p>
<p>4. 最后通过把item.Result任务结果添加到集合中,返回我们需要的数据</p>
<p>这里解析博客内容信息用的正则表达式,这种方式在抓取一定内容上很方便;群里面有些朋友对正则有点反感,刚接触的时候觉得挺不好写的,所以一般都采用更复杂或者其他的解析方式来获取想要的内容,这里提出来主要是和这些朋友分享下正则获取数据是多么方便,很有必要学习下并且掌握常规的用法,这也是一种苦尽甘来的体验吧哈哈;</p>
<p>好了咋们创建一个webapi项目取名为 Stage.Api ,使用她自动生成的 ValuesController 文件里面的Get方法接口来调用咋们上面实现的博客抓取方法,代码如下:</p>
<p></p><pre class="brush:php;toolbar:false;">// GET api/values
  public async Task<IEnumerable<MoBlog>> Get(int task = 6)
  {
   task = task <= 0 ? 6 : task;
   task = task > 50 ? 50 : task;
   IBlogsReposity _reposity = new BoKeYuan();
   return await _reposity.GetBlogs(task);
  }</pre><p></p>
<p>这里使用 IBlogsReposity _reposity = new BoKeYuan(); 来创建和调用具体的实现类,这里贴出一个线上抓取博客首页信息的地址(不要告诉dudu):http://www.php.cn/:1001/api/values?task=6;咋们来想象一下,如果这个Get方法中还需要调用其他实现了接口 IBlogsReposity 的博客抓取类,那咋们又需要手动new一次来创建对应的对象;倘若除了在 ValuesController.cs 文件中调用了博客数据抓取,其他文件还需要这抓取数据的业务,那么又会不停的new,可能有朋友就会说那弄一个工厂模式怎么样,不错这是可行的一种方式,不过这里还有其他方法能处理这种问题,比如:ioc依赖注入;因此就有了下面的分享内容。</p>
<p>» IOC框架Ninject的使用</p>
<p>首先,我们要使用ninject需要使用nuget下载安装包,这里要注意的是Ninject版本比较多,需要选择合适自己webapi的版本,我这里选择的是:</p>
<p><img src="https://img.php.cn/upload/article/000/000/013/d420cefe27027c5c3b22b52dc6ccf265-0.png" alt="webapi中如何使用依赖注入"    style="max-width:90%"  style="max-width:90%" title="webapi中如何使用依赖注入"></p>
<p>看起来很老了哈哈,不过咋们能用就行,安装起来可能需要点时间,毕竟比较大么也有可能是网络的问题吧;安装完后咋们创建一个自定义类 NinjectResolverScope 并实现接口 IDependencyScope , IDependencyScope 对应的类库是 System.Web.Http.dll (注:由于webapi2项目自动生成时候可能勾选了mvc,mvc框架里面也包含了一个IDependencyScope,所以大家需要注意区分下),好了咋们来直接看下 NinjectResolverScope 实现代码:</p>
<p></p><pre class="brush:php;toolbar:false;">/// <summary>
 /// 解析
 /// </summary>
 public class NinjectResolverScope : IDependencyScope
 {
  private IResolutionRoot root;
  public NinjectResolverScope() { }
  public NinjectResolverScope(IResolutionRoot root)
  {
   this.root = root;
  }
  public object GetService(Type serviceType)
  {
   try
   {
    return root.TryGet(serviceType);
   }
   catch (Exception ex)
   {
    return null;
   }
  }
  public IEnumerable<object> GetServices(Type serviceType)
  {
   try
   {
    return this.root.GetAll(serviceType);
   }
   catch (Exception ex)
   {
    return new List<object>();
   }
  }
  public void Dispose()
  {
   var disposable = this.root as IDisposable;
   if (disposable != null)
    disposable.Dispose();

   this.root = null;
  }
 }</pre><p></p>
<p>这里要注意的是GetService和GetServices方法必须使用  try...catch() 包住,经过多方调试和测试,这里面会执行除手动bind绑定外的依赖,还会执行几个其他非手动绑定的实例对象,这里使用try避免抛异常影响到程序(其实咋们可以在这里用代码过滤掉非手动绑定的几个实例);这里也简单说下这个 NinjectResolverScope 中方法执行的先后顺序:GetService=》GetServices=》Dispose,GetService主要用来获取依赖注入对象的实例;好了到这里咋们还需要一个自定义容器类 NinjectResolverContainer ,该类继承自上面的 NinjectResolverScope 和实现 IDependencyResolver 接口(其实细心的朋友能发现这个 IDependencyResolver 同样也继承了 IDependencyScope ),具体代码如下:</p><div class="aritcle_card flexRow">
							<div class="artcardd flexRow">
								<a class="aritcle_card_img" href="/ai/1007" title="LALAL.AI"><img
										src="https://img.php.cn/upload/ai_manual/000/000/000/175680056568451.png" alt="LALAL.AI"></a>
								<div class="aritcle_card_info flexColumn">
									<a href="/ai/1007" title="LALAL.AI">LALAL.AI</a>
									<p>AI人声去除器和声乐提取工具</p>
								</div>
								<a href="/ai/1007" title="LALAL.AI" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a>
							</div>
						</div>
<p></p><pre class="brush:php;toolbar:false;">public class NinjectResolverContainer : NinjectResolverScope, IDependencyResolver
 {
  private IKernel kernel;
  public static NinjectResolverContainer Current
  {
   get
   {
    var container = new NinjectResolverContainer();
    //初始化
    container.Initing();
    //绑定
    container.Binding();
    return container;
   }
  }
  /// <summary>
  /// 初始化kernel
  /// </summary>
  void Initing()
  {
   kernel = new StandardKernel();
  }
  /// <summary>
  /// 绑定
  /// </summary>
  void Binding()
  {
   kernel.Bind<IBlogsReposity>().To<BoKeYuan>();
  }
  /// <summary>
  /// 开始执行
  /// </summary>
  /// <returns></returns>
  public IDependencyScope BeginScope()
  {
   return new NinjectResolverScope(this.kernel.BeginBlock());
  }
 }</pre><p></p>
<p>这里能够看到 IKernel kernel = new StandardKernel(); 这代码,她们引用都来源于我们安装的Ninject包,通过调用初始化Initing()后,我们需要在Binding()方法中手动绑定我们对应需要依赖注入的实例,Ninject绑定方式有很多种这里我用的格式是: kernel.Bind().To(); 如此简单就实现了依赖注入,每次我们需要添加不同的依赖项的时候只需要在这个Binding()中使用Bind.To()即可绑定成功;好了为了验证咋们测试成功性,我们需要在apiController中使用这个依赖关系,这里我使用构造函数依赖注入的方式:</p>
<p></p><pre class="brush:php;toolbar:false;">private readonly IBlogsReposity _reposity
  public ValuesController(IBlogsReposity reposity)
  {
   _reposity = reposity;
  }
  // GET api/values 
  public async Task<IEnumerable<MoBlog>> Get(int task = 6)
  {
   task = task <= 0 ? 6 : task;
   task = task > 50 ? 50 : task;
   return await _reposity.GetBlogs(task);
  }</pre><p></p>
<p>代码如上所示,我们运行下程序看下效果:</p>
<p><img src="https://img.php.cn/upload/article/000/000/013/d420cefe27027c5c3b22b52dc6ccf265-1.png" alt="webapi中如何使用依赖注入"    style="max-width:90%"  style="max-width:90%" title="webapi中如何使用依赖注入"></p>
<p>这个时候提示了个错误“没有默认构造函数”;我们刚才使用的构造函数是带有参数的,而自定义继承的 ApiController 中有一个无参数的构造函数,根据错误提示内容完全无解;不用担心,解决这个问题只需要在 WebApiConfig.cs 中Register方法中增加如下代码:</p>
<p></p><pre class="brush:php;toolbar:false;">
 //Ninject ioc
 config.DependencyResolver = NinjectResolverContainer.Current;</pre><p></p>
<p>这句代码意思就是让程序执行上面咋们创建的容器 NinjectResolverContainer ,这样才能执行到我能刚才写的ioc程序,才能实现依赖注入;值得注意的是 config.DependencyResolver 是webapi自带的提供的,mvc项目也有同样提供了 DependencyResolver  给我们使用方便做依赖解析;好了这次我们在运行项目可以得到如图效果:</p>
<p><img src="https://img.php.cn/upload/article/000/000/013/d420cefe27027c5c3b22b52dc6ccf265-2.png" alt="webapi中如何使用依赖注入"    style="max-width:90%"  style="max-width:90%" title="webapi中如何使用依赖注入"></p>
<p>» IOC框架Unity的使用</p>
<p>首先,安装Unity和Unity.WebAPI的nuget包,我这里的版本是:</p>
<p><img src="https://img.php.cn/upload/article/000/000/013/86da516e8e692253414b5c6ae24ed85b-3.png" alt="webapi中如何使用依赖注入"    style="max-width:90%"  style="max-width:90%" title="webapi中如何使用依赖注入"></p>
<p>我们再同样创建个自定义容器类 UnityResolverContainer ,实现接口 IDependencyResolver (这里和上面Ninject一样);然后这里贴上具体使用Unity实现的方法:</p>
<p></p><pre class="brush:php;toolbar:false;">public class UnityResolverContainer : IDependencyResolver
 {
  private IUnityContainer _container;
  public UnityResolverContainer(IUnityContainer container)
  {
   this._container = container;
  }
  public IDependencyScope BeginScope()
  {
   var scopeContainer = this._container.CreateChildContainer();
   return new UnityResolverContainer(scopeContainer);
  }
  /// <summary>
  /// 获取对应类型的实例,注意try...catch...不能够少
  /// </summary>
  /// <param name="serviceType"></param>
  /// <returns></returns>
  public object GetService(Type serviceType)
  {
   try
   {
    //if (!this._container.IsRegistered(serviceType)) { return null; }
    return this._container.Resolve(serviceType);
   }
   catch
   {
    return null;
   }
  }
  public IEnumerable<object> GetServices(Type serviceType)
  {
   try
   {
    return this._container.ResolveAll(serviceType);
   }
   catch
   {
    return new List<object>();
   }
  }
  public void Dispose()
  {
   if (_container != null)
   {
    this._container.Dispose();
    this._container = null;
   }
  }
 }</pre><p></p>
<p> 这里和使用Ninject的方式很类似,需要注意的是我们在安装Unity包的时候会自动在 WebApiConfig.cs 增加如下代码:</p>
<p></p><pre class="brush:php;toolbar:false;">
 //Unity ioc
UnityConfig.RegisterComponents();</pre><p></p>
<p>然后同时在 App_Start 文件夹中增加 UnityConfig.cs 文件,我们打开此文件能看到一些自动生成的代码,这里我们就可以注册绑定我们的依赖,代码如:</p>
<p></p><pre class="brush:php;toolbar:false;">public static class UnityConfig
 {
  public static void RegisterComponents()
  {
   var container = new UnityContainer();
   container.RegisterType<IBlogsReposity, BoKeYuan>();
   // var lifeTimeOption = new ContainerControlledLifetimeManager();
   //container.RegisterInstance<IBlogsReposity>(new BoKeYuan(), lifeTimeOption);
   GlobalConfiguration.Configuration.DependencyResolver = new UnityResolverContainer(container);
  }
 }</pre><p></p>
<p>这里展示了两种注册依赖的方式: container.RegisterType<iblogsreposity bokeyuan>(); 和 container.RegisterInstance<iblogsreposity>(new BoKeYuan(), lifeTimeOption); ,当然还有其他的扩展方法这里就不举例了;最后一句代码: GlobalConfiguration.Configuration.DependencyResolver = new UnityResolverContainer(container); 和我们之前Ninject代码一样,只是换了一个地方和实例化写法方式而已,各位可以仔细对比下;其实 UnityConfig.cs 里面的内容都可以移到 WebApiConfig.cs 中去,unity自动分开应该是考虑到代码内容分块来管理吧,好了同样我们使用自定义的 ValuesController 的构造函数来添加依赖:</iblogsreposity></iblogsreposity></p>
<p></p><pre class="brush:php;toolbar:false;">public class ValuesController : ApiController
 {
  private readonly IBlogsReposity _reposity;
  public ValuesController(IBlogsReposity reposity)
  {
   _reposity = reposity;
  }
  // GET api/values 
  public async Task<IEnumerable<MoBlog>> Get(int task = 6)
  {
   task = task <= 0 ? 6 : task;
   task = task > 50 ? 50 : task;
   return await _reposity.GetBlogs(task);
  }
}</pre><p></p>
<p>从代码上来看,这里面Ninject和Unity的注入方式没有差异,这样能就让我们开发程序的时候两种注入方式可以随便切换了,最后来我这里提供一个使用这个webapi获取数据绑定到页面上的效果:</p>
<p><img src="https://img.php.cn/upload/article/000/000/013/86da516e8e692253414b5c6ae24ed85b-4.png" alt="webapi中如何使用依赖注入"    style="max-width:90%"  style="max-width:90%" title="webapi中如何使用依赖注入"></p>
<p>更多webapi中如何使用依赖注入相关文章请关注PHP中文网!</p>					</div>
					<div class="artmoreart ">
													<div class="artdp artptit"><span></span>
								<p>相关文章</p>
							</div>
							<div class="artmores flexColumn">
																	<a class="artmrlis flexRow" href="/faq/1897326.html" title="C# Avalonia怎么和Web API交互 Avalonia Rest API调用"><b></b>
										<p class="overflowclass">C# Avalonia怎么和Web API交互 Avalonia Rest API调用</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1855593.html" title="ASP.NET Core怎么创建Web API ASP.NET Core创建RESTful API步骤"><b></b>
										<p class="overflowclass">ASP.NET Core怎么创建Web API ASP.NET Core创建RESTful API步骤</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1851157.html" title="Minimal API怎么用 .NET 6 Minimal API入门教程"><b></b>
										<p class="overflowclass">Minimal API怎么用 .NET 6 Minimal API入门教程</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1841043.html" title="Blazor WASM AOT 提升运行时性能的方法"><b></b>
										<p class="overflowclass">Blazor WASM AOT 提升运行时性能的方法</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1837196.html" title="JS 调用 C# .NET 方法教程"><b></b>
										<p class="overflowclass">JS 调用 C# .NET 方法教程</p>
									</a>
															</div>
						
						<p class="statement">本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn</p>
						<div class="lastanext flexRow">
													<a class="lastart flexRow" href="/faq/351532.html" title="Asp.net MVC利用knockoutjs实现登陆并记录用户的内外网IP及所在城市"><span>上一篇:</span>Asp.net MVC利用knockoutjs实现登陆并记录用户的内外网IP及所在城市</a>
													<a class="nextart flexRow" href="/faq/351534.html" title=".NET MD5加密解密代码解析"><span>下一篇:</span>.NET MD5加密解密代码解析</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/338018.html" title="实现一个 Java 版的 Redis"><b></b>
												<p class="overflowclass">实现一个 Java 版的 Redis</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-30 13:56</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/346502.html" title="Asp.net使用SignalR实现发送图片"><b></b>
												<p class="overflowclass">Asp.net使用SignalR实现发送图片</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-28 16:22</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/350853.html" title="HTML5:使用Canvas实时处理Video"><b></b>
												<p class="overflowclass">HTML5:使用Canvas实时处理Video</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-28 17:58</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/353509.html" title="最简单的微信小程序Demo"><b></b>
												<p class="overflowclass">最简单的微信小程序Demo</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-30 10:20</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/354423.html" title="Python构造自定义方法来美化字典结构输出"><b></b>
												<p class="overflowclass">Python构造自定义方法来美化字典结构输出</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-29 10:33</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/354750.html" title="html设置加粗、倾斜、下划线、删除线等字体效果示例介绍"><b></b>
												<p class="overflowclass">html设置加粗、倾斜、下划线、删除线等字体效果示例介绍</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-31 09:48</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/354839.html" title=" 微信小程序:如何实现tabs选项卡效果示例"><b></b>
												<p class="overflowclass"> 微信小程序:如何实现tabs选项卡效果示例</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-29 15:01</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/354842.html" title="微信小程序开发教程-App()和Page()函数概述"><b></b>
												<p class="overflowclass">微信小程序开发教程-App()和Page()函数概述</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-28 16:19</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/356272.html" title="python中pandas.DataFrame(创建、索引、增添与删除)的简单操作方法介绍"><b></b>
												<p class="overflowclass">python中pandas.DataFrame(创建、索引、增添与删除)的简单操作方法介绍</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-29 15:23</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/356574.html" title="详解python redis使用方法"><b></b>
												<p class="overflowclass">详解python redis使用方法</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2018-05-28 15:01</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   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/723" title="DeepSeek" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/723" title="DeepSeek" class="overflowclass abripone">DeepSeek</a>
												<p class="overflowclass abriptwo">幻方量化公司旗下的开源大模型平台</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/code" target="_blank" >AI 编程开发</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/chat" target="_blank" >AI 聊天问答</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/726" title="豆包大模型" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/726" title="豆包大模型" class="overflowclass abripone">豆包大模型</a>
												<p class="overflowclass abriptwo">字节跳动自主研发的一系列大型语言模型</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/code" target="_blank" >AI 编程开发</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/code/large-model" target="_blank" >AI大模型</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/725" title="通义千问" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/725" title="通义千问" class="overflowclass abripone">通义千问</a>
												<p class="overflowclass abriptwo">阿里巴巴推出的全能AI助手</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/code" target="_blank" >AI 编程开发</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/ai-agent" target="_blank" >Agent智能体</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/854" title="腾讯元宝" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/854" title="腾讯元宝" class="overflowclass abripone">腾讯元宝</a>
												<p class="overflowclass abriptwo">腾讯混元平台推出的AI助手</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/office/docs" target="_blank" >文档处理</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/chat" target="_blank" >AI 聊天问答</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/724" title="文心一言" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/724" title="文心一言" class="overflowclass abripone">文心一言</a>
												<p class="overflowclass abriptwo">文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/code" target="_blank" >AI 编程开发</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/text" target="_blank" >AI 文本写作</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/1507" title="讯飞写作" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/1507" title="讯飞写作" class="overflowclass abripone">讯飞写作</a>
												<p class="overflowclass abriptwo">基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/text" target="_blank" >AI 文本写作</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/text/chinese-writing" target="_blank" >中文写作</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/1115" title="即梦AI" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/1115" title="即梦AI" class="overflowclass abripone">即梦AI</a>
												<p class="overflowclass abriptwo">一站式AI创作平台,免费AI图片和视频生成。</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="" target="_blank" ></a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/image/image-titching" target="_blank" >图片拼接</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/808" title="ChatGPT" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/808" title="ChatGPT" class="overflowclass abripone">ChatGPT</a>
												<p class="overflowclass abriptwo">最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/code" target="_blank" >AI 编程开发</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/text" target="_blank" >AI 文本写作</a>													</div>
																							</div>
										</div>
									</div>
																	<div class="aidcons flexRow   ">
										<div   class="aibtns flexRow">
											<a target="_blank" href="/ai/821" title="智谱清言 - 免费全能的AI助手" class="aibtnsa 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'">
											</a>
											<div class="aibtn-right flexColumn">
												<a target="_blank" href="/ai/821" title="智谱清言 - 免费全能的AI助手" class="overflowclass abripone">智谱清言 - 免费全能的AI助手</a>
												<p class="overflowclass abriptwo">智谱清言 - 免费全能的AI助手</p>
																									<div class="aidconstab flexRow">
														<a class="aidcontbp flexRow flexcenter"  href="/ai/tag/code" target="_blank" >AI 编程开发</a><a class="aidcontbp flexRow flexcenter"  href="/ai/tag/ai-agent" target="_blank" >Agent智能体</a>													</div>
																							</div>
										</div>
									</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/csjmsyrjjg" class="aClass flexRow hotzta" title="C++ 设计模式与软件架构"><img
										src="https://img.php.cn/upload/subject/202601/30/2026013010035824284.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="C++ 设计模式与软件架构" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/csjmsyrjjg" class="aClass flexRow hotztra overflowclass" title="C++ 设计模式与软件架构">C++ 设计模式与软件架构</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题深入讲解 C++ 中的常见设计模式与架构优化,包括单例模式、工厂模式、观察者模式、策略模式、命令模式等,结合实际案例展示如何在 C++ 项目中应用这些模式提升代码可维护性与扩展性。通过案例分析,帮助开发者掌握 如何运用设计模式构建高质量的软件架构,提升系统的灵活性与可扩展性。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">14</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.30</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/cjjzfcgsh" class="aClass flexRow hotzta" title="c++ 字符串格式化"><img
										src="https://img.php.cn/upload/subject/202601/30/2026013009581328823.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="c++ 字符串格式化" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/cjjzfcgsh" class="aClass flexRow hotztra overflowclass" title="c++ 字符串格式化">c++ 字符串格式化</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了c++字符串格式化用法、输出技巧、实践等等内容,阅读专题下面的文章了解更多详细内容。</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.30</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/javazfcgsh" class="aClass flexRow hotzta" title="java 字符串格式化"><img
										src="https://img.php.cn/upload/subject/202601/30/2026013009503958383.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="java 字符串格式化" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/javazfcgsh" class="aClass flexRow hotztra overflowclass" title="java 字符串格式化">java 字符串格式化</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了java如何进行字符串格式化相关教程、使用解析、方法详解等等内容。阅读专题下面的文章了解更多详细教程。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">12</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.30</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/pythonzfcgsh" class="aClass flexRow hotzta" title="python 字符串格式化"><img
										src="https://img.php.cn/upload/subject/202601/30/2026013009412416721.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="python 字符串格式化" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/pythonzfcgsh" class="aClass flexRow hotztra overflowclass" title="python 字符串格式化">python 字符串格式化</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了python字符串格式化教程、实践、方法、进阶等等相关内容,阅读专题下面的文章了解更多详细操作。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">4</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.30</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/javarmxxhj" class="aClass flexRow hotzta" title="java入门学习合集"><img
										src="https://img.php.cn/upload/subject/000/000/075/697b40d167f7c445.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="java入门学习合集" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/javarmxxhj" class="aClass flexRow hotztra overflowclass" title="java入门学习合集">java入门学习合集</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了java入门学习指南、初学者项目实战、入门到精通等等内容,阅读专题下面的文章了解更多详细学习方法。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">20</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.29</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/javapzhjbljch" class="aClass flexRow hotzta" title="java配置环境变量教程合集"><img
										src="https://img.php.cn/upload/subject/000/000/075/697b3eeca4c96290.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="java配置环境变量教程合集" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/javapzhjbljch" class="aClass flexRow hotztra overflowclass" title="java配置环境变量教程合集">java配置环境变量教程合集</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了java配置环境变量设置、步骤、安装jdk、避免冲突等等相关内容,阅读专题下面的文章了解更多详细操作。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">18</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.29</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/javacpxxwz" class="aClass flexRow hotzta" title="java成品学习网站推荐大全"><img
										src="https://img.php.cn/upload/subject/000/000/075/697b3ce34c1ad790.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="java成品学习网站推荐大全" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/javacpxxwz" class="aClass flexRow hotztra overflowclass" title="java成品学习网站推荐大全">java成品学习网站推荐大全</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了java成品网站、在线成品网站源码、源码入口等等相关内容,阅读专题下面的文章了解更多详细推荐内容。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">19</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.29</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/javazfcclsyjc" class="aClass flexRow hotzta" title="Java字符串处理使用教程合集"><img
										src="https://img.php.cn/upload/subject/000/000/075/697b3a2f0eba1672.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="Java字符串处理使用教程合集" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/javazfcclsyjc" class="aClass flexRow hotztra overflowclass" title="Java字符串处理使用教程合集">Java字符串处理使用教程合集</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了Java字符串截取、处理、使用、实战等等教程内容,阅读专题下面的文章了解详细操作教程。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">3</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.29</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/javakdxxgjchj" class="aClass flexRow hotzta" title="Java空对象相关教程合集"><img
										src="https://img.php.cn/upload/subject/000/000/075/697b37db731a5352.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="Java空对象相关教程合集" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/javakdxxgjchj" class="aClass flexRow hotztra overflowclass" title="Java空对象相关教程合集">Java空对象相关教程合集</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了Java空对象相关教程,阅读专题下面的文章了解更多详细内容。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">6</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2026.01.29</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/8740"><span>[图片特效]</span><span>jQuery鼠标滚轮控制幻灯片切换</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery微信手机端答题表单特效" href="/xiazai/js/8739"><span>[表单按钮]</span><span>jQuery微信手机端答题表单特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="js正则表达式表单验证代码" href="/xiazai/js/8738"><span>[表单按钮]</span><span>js正则表达式表单验证代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="CSS3图片形状遮罩动画效果" href="/xiazai/js/8737"><span>[图片特效]</span><span>CSS3图片形状遮罩动画效果</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="div css手机网站login表单特效" href="/xiazai/js/8736"><span>[表单按钮]</span><span>div css手机网站login表单特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="qq空间遮罩层jQuery相册切换" href="/xiazai/js/8735"><span>[图片特效]</span><span>qq空间遮罩层jQuery相册切换</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jquery衣服尺寸勾选表单" href="/xiazai/js/8734"><span>[表单按钮]</span><span>jquery衣服尺寸勾选表单</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="22款不同效果产品图片展示切换" href="/xiazai/js/8733"><span>[图片特效]</span><span>22款不同效果产品图片展示切换</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jquery带登录注册幻灯片代码" href="/xiazai/js/8732"><span>[表单按钮]</span><span>jquery带登录注册幻灯片代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery图片放大变小切换代码" href="/xiazai/js/8731"><span>[图片特效]</span><span>jQuery图片放大变小切换代码</span></a>
									</div>
								</li>
													</ul>
						<ul class="twof" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11355" title="openaishop"><span>[电商源码]</span><span>openaishop</span> </a>
									</div>
								</li>
															<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>
													</ul>
						<ul class="threef" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4307" title="手绘烘焙面包食材合集矢量素材"><span>[网站素材]</span><span>手绘烘焙面包食材合集矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4306" title="复古红日山峰风景矢量素材"><span>[网站素材]</span><span>复古红日山峰风景矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4305" title="极简复古意大利面海报矢量模板"><span>[网站素材]</span><span>极简复古意大利面海报矢量模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4304" title="国风红色灯笼装饰合集矢量素材"><span>[网站素材]</span><span>国风红色灯笼装饰合集矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4303" title="快餐美食宣传海报模板INS下载"><span>[网站素材]</span><span>快餐美食宣传海报模板INS下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4302" title="卡通灯塔房屋建筑合集矢量素材"><span>[网站素材]</span><span>卡通灯塔房屋建筑合集矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4301" title="黑色耳机宣传海报PSD模板设计下载"><span>[网站素材]</span><span>黑色耳机宣传海报PSD模板设计下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4300" title="冬季蓝色雪花松枝合集矢量素材"><span>[网站素材]</span><span>冬季蓝色雪花松枝合集矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4299" title="情人节爱心主题海报PSD源文件设计下载"><span>[网站素材]</span><span>情人节爱心主题海报PSD源文件设计下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4298" title="2026粉色梦幻马年矢量模板"><span>[网站素材]</span><span>2026粉色梦幻马年矢量模板</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商城系统" href="/xiazai/code/11178">php商城系统</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="淘源码商城PHP淘宝查信誉" href="/xiazai/code/11177">淘源码商城PHP淘宝查信誉</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP房产程序[BBWPS]" href="/xiazai/code/11165">PHP房产程序[BBWPS]</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP简约自动发卡平台个人版" href="/xiazai/code/11128">PHP简约自动发卡平台个人版</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="ERMEB域名PHP离线网络授权系统" href="/xiazai/code/11040">ERMEB域名PHP离线网络授权系统</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="Difeye-敏捷的轻量级PHP框架" href="/xiazai/code/11037">Difeye-敏捷的轻量级PHP框架</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="大泉州汽车网PHP整站程序" href="/xiazai/code/10963">大泉州汽车网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/1643.html" title="MySQL 初学入门(mosh老师)">
									<img src="https://img.php.cn/upload/course/000/000/067/66123f1bad93f980.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="MySQL 初学入门(mosh老师)" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1643.html" title="MySQL 初学入门(mosh老师)"
										class="rirightp overflowclass">MySQL 初学入门(mosh老师)</a>

									<div class="risrdown flexRow">
										<p>共3课时 | 0.3万人学习</p>
									</div>
								</div>
							</div>
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1641.html" title="微信小程序开发之API篇">
									<img src="https://img.php.cn/upload/course/000/000/067/65d41178b1265633.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="微信小程序开发之API篇" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1641.html" title="微信小程序开发之API篇"
										class="rirightp overflowclass">微信小程序开发之API篇</a>

									<div class="risrdown flexRow">
										<p>共15课时 | 1.2万人学习</p>
									</div>
								</div>
							</div>
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1632.html" title="PHP自制框架">
									<img src="https://img.php.cn/upload/course/000/000/067/659b8e76ada36516.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/1632.html" title="PHP自制框架"
										class="rirightp overflowclass">PHP自制框架</a>

									<div class="risrdown flexRow">
										<p>共8课时 | 0.6万人学习</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课时 | 11.2万人学习</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.8万人学习</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课时 | 22.4万人学习</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课时 | 11.2万人学习</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="c# await foreach 是什么" href="/faq/2047418.html">c# await foreach 是什么</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# 动态PGO优化方法 C# Dynamic PGO如何提升应用性能" href="/faq/2047377.html">C# 动态PGO优化方法 C# Dynamic PGO如何提升应用性能</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# WPF Community Toolkit使用方法 C# MVVM Toolkit如何简化MVVM开发" href="/faq/2047368.html">C# WPF Community Toolkit使用方法 C# MVVM Toolkit如何简化MVVM开发</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# ML.NET入门方法 C#如何进行机器学习情感分析" href="/faq/2047348.html">C# ML.NET入门方法 C#如何进行机器学习情感分析</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# 类型转换方法 C#如何进行显式和隐式转换" href="/faq/2047156.html">C# 类型转换方法 C#如何进行显式和隐式转换</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# Uno Platform入门方法 C#如何使用Uno Platform构建跨所有平台的应用" href="/faq/2047137.html">C# Uno Platform入门方法 C#如何使用Uno Platform构建跨所有平台的应用</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# 链路追踪SkyWalking方法 C#如何集成SkyWalking APM" href="/faq/2047113.html">C# 链路追踪SkyWalking方法 C#如何集成SkyWalking APM</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# Humanizer库使用方法 C#如何将日期、数字转换为易读字符串" href="/faq/2047085.html">C# Humanizer库使用方法 C#如何将日期、数字转换为易读字符串</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="c# 在多线程代码中如何正确使用 Random 和 Guid" href="/faq/2047078.html">c# 在多线程代码中如何正确使用 Random 和 Guid</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="C# XML文件解析方法 C#如何使用Linq to XML解析XML" href="/faq/2047068.html">C# XML文件解析方法 C#如何使用Linq to XML解析XML</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=351533&time=1769794827">
</script>
<script src="/static/ueditor/third-party/SyntaxHighlighter/shCore.js?1769794827"></script>
<script>
	article_status = "13";
</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', '7']);
		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>