本文執行個體講述了php刪除指定目錄的方法。分享給大家供大家參考。具體分析如下:這段代碼可實現遞迴刪除子目錄的功能<?php/** * Delete a file, or a folder and its contents * (recursive algorithm) * @author Aidan Lister <aidan@php.net> * @version 1.0.3 * @param string $dirname Directory to
本文執行個體講述了php實現在限定地區裡自動調整字型大小的類。分享給大家供大家參考。具體如下:這裡的php類imagefittext.class.php實現在限定的地區裡自動調整字型大小的功能。<?php// Image Fit Text Class 0.1 by ming0070913CLASS ImageFitText{ public $font, $fontsize, $width, $height; public $step_wrap, $step_fontsize;
本文執行個體講述了php給一組指定關鍵詞添加span標籤的方法。分享給大家供大家參考。具體如下:這裡是php給一組指定的關鍵詞添加span標籤,高亮反白關鍵詞// Example use: $spanned = codeWords($string_containing_keywords);// My site: andrew.dx.am// Using colour==blue, but different arrays of words and different // colours
不知道原創要寫到隨筆裡。 All right ,第一篇博文。 有三個類: 1 . 過濾輸入(輕量級的) class input_filter 負責將參數,如$_GET,$_POST 這些過濾 傳回值類型為 數組,用作 made_sql 類的參數 2 . 轉換成SQL語句 class made_sql 參數的類型為數組和表名(字串),數組的鍵名為表的列名,值為插入值 傳回值類型為 字串 ,用作 mysql ->query方法 的參數 3 . 資料庫查詢 class mysql
本文執行個體講述了php產生圓角圖片的方法。分享給大家供大家參考。具體如下:複製代碼 代碼如下:<?php$image_file = $_GET['src'];$corner_radius = isset($_GET['radius']) ? $_GET['radius'] : 20; // The default corner radius is set to 20px$topleft = (isset($_GET['topleft']) and
本文執行個體講述了php產生zip檔案類。分享給大家供大家參考。具體如下:<?php /* By: Matt Ford Purpose: Basic class to create zipfiles */class zipFile { public $files = array(); public $settings = NULL; public $fileInfo = array ( "name" => "", "numFiles" => 0, "