Time of Update: 2016-07-25
來自PHPCMS /** * 轉義 javascript 代碼標記 * * @param $str * @return mixed */ function trim_script($str) { if(is_array($str)){ foreach ($str as $key => $val){ $str[$key] = trim_script($val); }
Time of Update: 2016-07-25
PHP擷取資料夾清單,檔案清單 /** * Goofy 2011-11-30 * getDir()去資料夾清單,getFile()去對應檔案夾下面的檔案清單,二者的區別在於判斷有沒有“.”尾碼的檔案,其他都一樣 *///擷取檔案目錄列表,該方法返回數組function getDir($dir) {$dirArray[]=NULL;if (false !=
Time of Update: 2016-07-25
將字串open_door轉化為OpenDoor,將abc_bcd_cde轉化成AbcBcdCde 【html代碼】 將字串open_door轉化為OpenDoor,將abc_bcd_cde轉化成AbcBcdCde 複製代碼
Time of Update: 2016-07-25
error_reporting(E_ALL);require 'Mail.php';require 'Mail/mime.php';$text = "Text version of email\nMessage made with PHP";$html = 'HTML version of email';$html .= 'Message made with ';$crlf = "\n";$from = 'from_address@163.com';$to = 'to_address@qq.
Time of Update: 2016-07-25
PHP:數組 給文章加關鍵字串連,像163文章內容自動加連結效果 $keys =array( array('網頁特效','/js_a/js.html'), array('seo','/seo/seo.html'), array('php','/phper/php.html'), array('jsp','/jsp/jsp.html'),
Time of Update: 2016-07-25
//年$year = date("Y");$beninTime = mktime(0,0,0,1,1,$year);$endTime = mktime(0,0,0,1,1,$year+1)-1;$weekArray = array();$isBegin = true;$forTime = 0;for ($time=$beninTime;$time$forTime++;$start = $end =
Time of Update: 2016-07-25
/** * Goofy 2011-11-29 * 影像處理:根據傳遞過來的座標參數,x,y,w,h,依次為選取的x座標,y座標,w寬度,h高度 * 通過imagecopy()方法將該地區copy至第一步建立的空白映像中 * 注意,在建立映像的時候要用imagecreatetruecolor()真彩色,不然用imagecreate()圖片會失真 */
Time of Update: 2016-07-25
分享21個常用的PHP函數程式碼片段 1. PHP可閱讀隨機字串此代碼將建立一個可閱讀的字串,使其更接近詞典中的單詞,實用且具有密碼驗證功能。/***************@length – length of random string (must be a multiple of 2)**************/function
Time of Update: 2016-07-25
php將資料匯出為execl檔案格式 ?session_start(); $sql_excel=""; if(isset($_SESSION["excel"])) { $sql_excel=$_SESSION["excel"]; }
Time of Update: 2016-07-25
多內容實現分頁php $aa =
Time of Update: 2016-07-25
將csdn純文字密碼大量匯入進mysql資料庫 set_time_limit(13600); //設定時間$conn=mysql_connect('localhost','root',''); //串連資料庫mysql_select_db('csdn',$conn);mysql_query("SET NAMES utf8");$file=file('csdn.txt')
Time of Update: 2016-07-25
我想知道21712341byte在K位上是多少,M位上、G位呢?這相當於進位轉換的問題。只不過現在要轉換的進位是1024.
Time of Update: 2016-07-25
1,主題所使用的檔案夾在wp-content/themes/所對應的主題檔案夾 主題裡邊有-----functions.php(主題所用的函數主要在這個裡邊),在本檔案中添加如下代碼: register_nav_menus(array('header-menu' => __( '導航自訂菜單' ),));//即註冊導覽功能表2,在所用主題檔案夾中的header.php檔案中,把原來的 ">部落格 注釋掉, 換成 'header-menu' )); ?>代碼3
Time of Update: 2016-07-25
php實現簡單的日曆類 class calendar{private $year;private $month;private $day_week;function __construct(){$this->year=isset($_GET['year']) ? $_GET['year'] :
Time of Update: 2016-07-25
Ajax的小封裝對ajax的get請求的小封裝 function Ajax() {var xhr =null; if(window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { xhr = new
Time of Update: 2016-07-25
有的時候html檔案的編碼方式與meta資訊中指定的編碼方式不同,可以通過這段代碼搞一下。 此程式依賴jsoup和commons-io包 import java.io.File;import java.io.FileWriter;import java.io.IOException;import java.io.Writer;import
Time of Update: 2016-07-25
開始喜愛mybatis基於介面的方式了。 其實有兩部分改動(基於官網demo做的修改): 增加分頁外掛程式,簡單易用(自我感覺良好)。 增加一個BaseMapper,把常用的方法抽象到此介面中,避免在多個介面中重複定義(相當於常見的dao基類)。 基於maven並使用記憶體資料庫hsqldb,可直接運行junit測試。 public
Time of Update: 2016-07-25
private function directWriteXml(&$data){$xmltext='';$xmltext .='';$xmltext .='';$loop=count($data);foreach ($data as $d){$xmltext .=" ";}$xmltext .='';$xmltext .='';return $xmltext;}private function useDomDocument(&$data){//
Time of Update: 2016-07-25
package com.qimenguigu.l07131;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;/** * 輸入年,月,日,next|prior,如果是一個正確的日期,算出上一天或下一天 * * @author Longjie * @website www.qimenguigu.com */public class Title15 {public
Time of Update: 2016-07-25
客戶有各種稀奇的需求,現要求在使用平台過程中複製過的內容儲存並展示供使用人員參考 package cn.net.ssd.common.format;import java.awt.Image;import java.awt.Toolkit;import