Après avoir suivi, vous pouvez suivre ses informations dynamiques en temps opportun
Cours dans la section correspondante:Comment accéder aux variables globales dans une fonction ?
訪問全局變量的三種方式 1、關鍵字:global; 2、預定義變量:$GLOALS; 3、參數(shù)傳參數(shù):function($args){}
isset() 判斷
2018-11-070個贊
Cours dans la section correspondante:Quels sont les types de variables en PHP ?
php中的變量類型: 1、標準類型:整數(shù)(interger),浮點數(shù)(float),布爾(bool),字符串(string); 2、復合類型:數(shù)組(array),對象(object); 3、特殊類型:NULL(null),資源(resource).
數(shù)組:多個變量的集合,通過變量在集合中的索引來訪問,索引是從0開始; 對象:對象是內部封裝了屬性和方法的抽象類型,屬性相當于變量,方法相當于函數(shù)。
2018-11-080個贊
Cours dans la section correspondante:Comment créer et utiliser des scopes ?
作用域: 1、全局作用域:從腳本開始,直到腳本結束都有效; 2、函數(shù)作用域:僅在函數(shù)內有效,也叫局部作用域; 3、不受作用域影響的變量:系統(tǒng)預定義變量,常量。
什么是作用域? 1、函數(shù)可以創(chuàng)建一個作用域; 2、變量的訪問是受到作用域的影響的; 3、php中只存在函數(shù)作用域
2018-11-080個贊
Cours dans la section correspondante:Qu'est-ce qu'une constante et comment l'utiliser correctement ?
常量: 1、常量的本質:只讀變量,一旦定義,不能更新,不能刪除; 2、常量的定義:函數(shù)定義(define())和關鍵定定義(const); 3、作用域:不受作用域的影響。 unset():銷毀變量; define和const的區(qū)別: 很多情況可以通用,用表達式的值作為常量,只能用define; const它的常量值只允許標準變量:整數(shù)、浮點、布爾、字符串,必須是字面量。 const可以聲明類常量,define不可以。
2018-11-081個贊
Cours dans la section correspondante:Qu'est-ce qu'une fonction de rappel et comment l'exécuter ?
一、回調函數(shù):在一個函數(shù)中調用另一個函數(shù); 1、支持的函數(shù)類型:普通函數(shù),匿名函數(shù); 2、執(zhí)行回調函數(shù):call_user_func(函數(shù)名,參數(shù)1,參數(shù)2)/call_user_func_array();
2018-11-100個贊