Time of Update: 2018-07-24
轉載:http://www.php100.com/html/php/hanshu/2013/0905/4370.html 1. php檔案夾操作函數 string basename ( string path [, string suffix] ) 給出一個包含有指向一個檔案的全路徑的字串,本函數返回基本的檔案名稱。如果檔案名稱是以 suffix 結束的,那這一部分也會被去掉。 在 Windows
Time of Update: 2018-07-24
Ubuntu的Server和Desktop上都配過php的LAMP環境,步驟沒什麼區別,相關的教程網上也很多,這裡把自己的配置過程記錄下來,省得每次都google…供參考 整個環境用到Apache2、MySQL、php5和phpMyAdmin 1、安裝Apache2 $ sudo apt-get install apache2 1
Time of Update: 2018-07-24
一、安裝Nginx sudo apt-get update sudo apt-get install nginx nginx -v查看版本 二、安裝php7.0 sudo apt-get update sudo apt-get install php7.0 php -v查看版本 三、nginx適配php 修改/etc/nginx/sites-available/default如下: location ~ \.php$ { include
Time of Update: 2018-07-24
問題 安裝phpredis擴充,在PHP.ini中添加extension=redis.so後,編寫Redis.php檔案 <code class="language-php hljs has-numbering"><span class="hljs-comment">// Redis.php</span><span
Time of Update: 2018-07-24
php中的函數
Time of Update: 2018-07-24
<?php /** * ============================================================================ * 檔案操作類 * ============================================================================ * @author aiden * @version 1.0 */ &
Time of Update: 2018-07-24
有時候我們需要擷取函數需要傳入的參數,可以利用php的反射函數擷取,或者類裡面的所有公開的方法。 1、擷取函數參數名稱: function getFucntionParameterName($func) { $ReflectionFunc = new \ReflectionFunction($func); $depend = array(); foreach ($ReflectionFunc->getParameters() as $value) {
Time of Update: 2018-07-24
數列從第三項開始,每一項都等於前兩項之和。 F0=0,F1=1,Fn=F(n-1)+F(n-2) 遞迴版和非遞迴版。 [php] view plain copy <?php function fib($n){
Time of Update: 2018-07-24
當今,互連網的蓬勃發展,移動互連網的火熱,以及國家提出的“互連網+”。這些趨勢可以讓我們明顯的感覺到互連網的重要,不可替代。網站也是大家最早接觸,最早認識的一種新事物。談到網站,無非最長臉的莫過於 PHP(PHP: Hypertext Preprocessor,中文名:“超文本前置處理器”)這門開源的服務端指令碼語言。對於開源,這是他的優點也是缺點。優點是:你可以隨意的使用它並且不用支付一分錢,文法吸收了C語言、Java和Perl的特點,函數眾多,使用方便靈活,上手容易。缺點也是因為開源,
Time of Update: 2018-07-24
類檔案,Mobile_Detect.PHP [php] view plain copy /** * Mobile Detect Library * ======
Time of Update: 2018-07-24
刪除檔案夾 function deldir($dir) { //先刪除目錄下的檔案: $dh=opendir($dir); while ($file=readdir($dh)) { if($file!="." && $file!="..") { $fullpath=$dir."/".$file; if(!is_dir($fullpath)) { unlink(
Time of Update: 2018-07-24
安裝Nginx ,Mysql參見:http://blog.csdn.net/kingzuo/article/details/8648536 1,下載: php-5.4.12.tar.gz 並上傳的Linux 目錄/home #cd /home #tar zvxf php-5.4.12.tar.gz #cd php-5.4.12 #./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql
Time of Update: 2018-07-24
$Y = 2016;//擷取年,樣本,真實環境從前端擷取資料 $m = 8;//擷取月,樣本,真實環境從前端擷取資料 $month = $Y."-".$m;//當前年月 $month_start = strtotime($month);//指定月份月初時間戳記
Time of Update: 2018-07-24
php錯誤提示開啟關閉有兩種方式,一種是在php.ini設定檔中設定。另一種是在php檔案中利用函數ini_set()和error_reporting()設定。 1.在php.ini中找到 display_errors,設定錯誤提示的開啟和關閉,off時關,on時開。同時設定error_reporting的值代表錯誤的層級。 一些常用值 E_ALL (Show all errors, warnings and notices including coding
Time of Update: 2018-07-24
<?php//PHP整站防注入程式,需要在公用檔案中require_once本檔案//判斷magic_quotes_gpc狀態if (@get_magic_quotes_gpc()) { $_GET = sec($_GET); $_POST = sec($_POST); $_COOKIE = sec($_COOKIE); $_FILES = sec($_FILES);}$_SERVER = sec($_SERVER);function
Time of Update: 2018-07-24
聲明:本系列部落格參考資料《大話設計模式》,作者程傑。 策略模式定義了一系列的演算法,並將每一個演算法封裝起來,而且使它們還可以相互替換。策略模式讓演算法獨立於使用它的客戶而獨立變化,即封裝變化的演算法。 適用情境:
Time of Update: 2018-07-24
<?php$file=fopen("F:\\php.txt","r");/* * 最簡單的方法,把檔案讀取到數組裡面 * * *///echo nl2br(file_get_contents("F:\\php.txt")); ///* * 任意個字元的讀取 fread($file,length);while(!(feof($file))){$data=fread($file,3);echo (nl2br($
Time of Update: 2018-07-24
from: http://www.csdn.net/article/2014-09-26/2821885-exploring-of-the-php-2 摘要:PHP作為一門簡單而強大的語言,能夠提供很多Web適用的語言特性。從實踐出發,繼弱類型變數原理探究後,王帥將繼續帶大家弄清PHP核心中的一些常用部分,本期則是SAPI的深入理解。 SAPI是Server Application Programming
Time of Update: 2018-07-24
function getImage($url,$save_dir='',$filename=''){if(trim($url)==''){return
Time of Update: 2018-07-24
$start = microtime(true); $popArr = array(6,3,23,1,5,100,399,99,66); echo '6,3,23,1,5,100,399,99,66'; $len = count($popArr); for ($j=0; $j<$len; $j++) {