Time of Update: 2017-01-13
php依賴 yum install -y libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel libicu-devel openldap-devel 下載:php-5.5.23.tar.gz./configure --prefix=/root/tools/php5.5 --with-config-file-path=/root/tools/php5.5/etc
Time of Update: 2017-01-13
環境:系統:CentOS 6.4 x86_64PHP版本:php5.3.28一、檔案下載1、memcachememcache官網:http://pecl.php.net/package/memcachememcache下載:http://down.shshenchu.com/memcache-3.0.8.tgz二、安裝和配置1.下載和安裝memcache[root@server101 ~]# cd /usr/local/src/ //進入目錄[root@server101 src]# wget
Time of Update: 2017-01-13
strtr函數的另一種情況< ?php教程 echo strtr("i loves you","love","lovea"); ?> 結果是i loves you注意看第三個參數的a,在結果中並沒有出現4.我不建議用strtr以少換多ok,既然這個strtr函數挺麻煩為什麼還要用呢?原因是,它的速度很快據說,strtr 比 str_replace
Time of Update: 2017-01-13
//php代碼$mobilephone=trim($_post["smmobilephone"]); //手機號碼的正則驗證 if(preg_match("/^13[0-9]{1}[0-9]{8}$|15[0189]{1}[0-9]{8}$|189[0-9]{8}$/",$mobilephone)){
Time of Update: 2017-01-13
代碼如下複製代碼 //對多個數組排序$ar1 = array("10", 100, 100, "a");$ar2 = array(1, 3, "2", 1);array_multisort($ar1, $ar2);var_dump($ar1);var_dump($ar2);//本例中經過排序後,第一個數組將包含 "10","a",100,100。第二個數組將包含
Time of Update: 2017-01-13
代碼如下複製代碼 <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-
Time of Update: 2017-01-13
代碼如下複製代碼 <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-
Time of Update: 2017-01-13
代碼如下複製代碼 function get_url() { $url = $_server['request_uri']; $parse_url = parse_url($url); $query_url =
Time of Update: 2017-01-13
## 表的結構 `admin`# 代碼如下複製代碼 create table `admin` ( `id` mediumint(4) not null auto_increment, `us` varchar(50) not null default '', `pas` varchar(250) not null default '', unique key `id` (`id`)) type=myisam
Time of Update: 2017-01-13
匹配首尾空白字元的Regex:^s*|s*$ 評註:可以用來刪除行首行尾的空白字元(包括空格、定位字元、換頁符等等),非常有用的運算式$action = trim($_get['action']);if($action == "sub"){ $str = $_post['dir']; //if(!preg_match("/^[".chr(0xa1)
Time of Update: 2017-01-13
關於imagickimagick,可以供PHP調用ImageMagick功能的PHP擴充。使用這個擴充可以使PHP具備和ImageMagick相同的功能。用ImageMagick提供的API來進行圖片的建立與修改,這些操作已經封裝到擴充imagick中了,最終調用的是ImageMagick提供的API. 實踐篇:安裝編譯ImageMagick、imagick擴充配置環境說明:php安裝目錄:/usr/local/php5/php拓展目錄:/usr/local/php5/lib/php/
Time of Update: 2017-01-13
例子 代碼如下複製代碼 <script>var $_GET = new Object(); var _Rep = document.location.search.replace(/(\?|&)([\w\d_]+)=([^&]+)/g, "_GET['$2']='$3';$");eval('$'+unescape(_Rep.substr(0,_Rep.length-1)));for(i in $_GET)
Time of Update: 2017-01-13
經常聽到團隊的小夥說:這個版本的擴充真難找,在本地運行正常的代碼,上線之後卻運行異常…諸如此類的問題大多是因為系統差異、擴充缺失、版本差異引起的。要解決此類問題搭建一個和線上一致的多人開發環境即可解決。
Time of Update: 2017-01-13
最近由於要做一個php的介面,但是因為許可權問題,不能執行一些特定命令,原因是php以nobody來運行。網上搜尋了些解決方案,一種是使用su的方法,一種是以c程式來實現,還有一種是用super程式實現。比較了下,覺得super命令php調用起來更為方便一些,因此本篇主要介紹super的簡單實現方法。一、首先下載安裝super,過程如下:[root@ossec.cn ~]#wget ftp://ftp.ucolick.org/pub/users/will/super-3.30.0-tar.gz[
Time of Update: 2017-01-13
下載地址:http://pecl.php.net/package/APC。這個拓展更新速度比較慢,建議安裝最新版本,因為最新版本已解決某些未知BUG。安裝APC擷取APC:# cd /usr/local/src &&wget http://pecl.php.net/get/APC-3.1.13.tgz &&tar -zxvf APC-3.1.13.tgz &&cd APC-3.1.13編譯安裝:#
Time of Update: 2017-01-13
在編譯安裝php—fpm後,預設是不會開啟自動啟動的,需要進行一些配置才能開機啟動。執行vim /etc/init.d/php-fpm建立下面的內容:#!/bin/sh## php-fpm - this script starts and stops the php-fpm daemin## chkconfig: - 85 15# processname: php-fpm# config:
Time of Update: 2017-01-13
在Linux環境下配置安裝PHP環境(Apache2),參考了一些別人的配置方法,遇到問題上網查。下面就是安裝步驟: 一、安裝Apache2.2.221、到官網下載 http://httpd.apache.org/download.cgi 2、解壓 tar -zxvf httpd-2.2.22.tar.gz3、建立目標檔案夾(注意以下所有操作都時在root使用者下執行的) mkdir
Time of Update: 2017-01-13
php教程+ajax亂碼解決方案/*出現亂碼原因可以就是php處理頁面與發送資料的頁面編碼不一致,我們只要設定一致就OK了。下面看個執行個體*/header("Content-Type=text/html;charset=gbk;");?><script>var xmlHttp=false;var requestType="";function createXMLHttpRequest() &
Time of Update: 2017-01-13
html 轉換php教程 代碼function htmlphp(){ var input = document.htphp.input.value; output = "echo""; for (var c = 0; c < input.length; c++){ if ((input.charAt(c) == "n" || input.charAt(c) == "r"
Time of Update: 2017-01-13
JavaScript表單驗證是否為中文,判斷一個輸入量是否為中文,通過Regex實現。// 檢查是否為中文function isChn(str){var reg = /^[u4E00-u9FA5]+$/;if(!reg.test(str)){return false;}return true;} if (escape(str).indexOf("%u")!=-1) alert("含有漢字"); else