<?php//function get_article(){// $conn=mysqli_connect("localhost","ro...
387
<!DOCTYPE html><html> &...
1592
<?php header("content-type:text/html;charset=utf-8"); //1.創(chuàng)建PDO對(duì)象,連接數(shù)據(jù)庫(kù) $pdo=new ...
419
controller/Index.php<?php namespace app\index\controller; use app\index\model\SlideMode...
368
controller/Slide.php<?php namespace app\admin\controller; use app\admin\controller\Comm...
306
controller/Sort.php<?php namespace app\admin\controller; use app\admin\controller\Commo...
366
controller/news<?php namespace app\admin\controller; use app\admin\controller\Common; u...
1793
1、用phpstorm打開項(xiàng)目,執(zhí)行composer require topthink/think-captcha2、在config目錄下建captcha.php文件,如圖:
315
<?php/** * 流程控制之分支結(jié)構(gòu) * 1. 分支:單分支,雙分支,多分支,switch * 2. 分支結(jié)構(gòu)使用腳本具備了簡(jiǎn)單的人工智能 *//**...
422
<?php/** * 教學(xué)內(nèi)容: 什么是閉包? * 1. 提到閉包,就不得不提匿名函數(shù),php官方手冊(cè)中,將閉包與匿名函數(shù)視為等同的 * 2. 閉包的三種使用場(chǎng)景:...
346
<?php/** * 教學(xué)內(nèi)容: 為什么說(shuō)常量是只讀變量? * 1. 常量的作用: 有一個(gè)腳本中,有一些數(shù)據(jù)是不會(huì)發(fā)生變化的,例如用戶的國(guó)籍,登錄狀態(tài)等 *&nbs...
1532
<?php/** * 教學(xué)內(nèi)容:程序主要是由什么組成的? * 知識(shí)點(diǎn): * 1. 程序主要是由變量和函數(shù)組成的 * 2. 變量的命名,定義與訪問(wèn) ...
293
echo (function($a){ &n...
181
PHP有函數(shù)作用域,//$a作用域?yàn)楹瘮?shù)sumfunction sum(){ $a=10; return $...
249
<?php//聲明相加函數(shù) function sum($a,$b){ $total=$a+$b; return $total; }//調(diào)用sum函數(shù)echo sum(10,20);
448