Zend OPCache加速PHP使用说明

 更新时间:2016年11月25日 15:46  点击:1766
本文章晋级人大家介绍Zend OPCache加速PHP使用说明,有需要了解的朋友可参考参考。

Zend Opcache配置方法

Zend Opcache 已经集成在了PHP 5.5里面,编译安装PHP5.5的时候加上--enable-opcache就行了。但也支持低版本的 PHP 5.2.*, 5.3.*, 5.4.*,未来会取消对5.2的支持,下面是我在PHP 5.4下的安装方法:

依次执行下面的命令

 代码如下 复制代码

wget http://pecl.php.net/get/zendopcache-7.0.2.tgz
tar xzf zendopcache-7.0.2.tgz
cd zendopcache-7.0.2
phpize

如果找不到phpize 的话自己找PHP路径,我的在/usr/local/php/bin/phpize,下面这行也要按你的php.ini路径自行修改

 代码如下 复制代码

./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

如果显示Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20100525/

表示安装完成,下面要修改php的配置文件让它生效

在 php.ini 的最后面加入下面几行

 代码如下 复制代码

zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20100525/opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

128意思是给它分配128M内存,然后重启apache,用phpinfo查看是否生效,显示下面的信息就说明生效了

Zend Opcache是否生效

可以通过phpinfo查看是否生效,下图是我的配置PHP扩展:


Zend Opcache

Zend Opcache已经生效了,如果不行可参考正同方法来解决

配置OPC还是比较简单的,eAccelerator被我干掉了,重复的功能。配置如下:

 代码如下 复制代码

wget http://pecl.php.net/get/zendopcache-7.0.2.tgz
tar xzf zendopcache-7.0.2.tgz
cd zendopcache-7.0.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make

make install接着呢,配置下php.ini,在最后加上:

[opcache]

 代码如下 复制代码

zend_extension=opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.enable=1

一般来说,按照以往的经验,如果加在ZendGuardLoader之前会稳定多

本文章来给各位同学介绍php 二维数组的分组排序实现代码,有需要了解的朋友可参考。

分组排序

 代码如下 复制代码

<?php
$new2['group']['key']='time';
$new['aa']['b']=44;
$new['aa']['c']=33;
$new['aa']['d']=34;
$new['bb']['b']=55;
$new['bb']['c']=32;
$new['cc']['4']=77;
$new['dd']['g']=55;
$new['dd']['c']=54;

function arr_group_sort($new){
     foreach($new as $key=>$val){
          asort($new[$key]);//分别对每一组的数据进行排序;
          $tmp=$new[$key];//将排序后的数据赋值给一个临时数组;
          $tmp[]=$key;//将原来数组的键值加入到临时数组的末尾,为后期的修改键值的步骤做准备;
          $a=array_shift($new[$key]);//将每一组的第一项(最小项)数据取出来,以aa组为例子,$a此时的值就为33;
          $aa[$a]=$tmp;//新建一个数组,以$aa(比如33)为键值;
          ksort($aa);//按照键值排序
     }
     foreach($aa as $key=>$val){//按照键值排序的数组,已经失去了原来的键值,比如aa/bb/cc/dd之类的,好在我们之前已经将键值存入了临时数组的末尾;
          $b=array_pop($aa[$key]);//将键值取出来;
          $bb[$b]=$aa[$key];//从新建立一个数组,使用之前的键值(aa/bb/cc)
     }
     return $bb;//返回
}

$c=arr_group_sort($new);
print_r($new);//原数组;
print_r($c);//分组排序后的数组;
?>

其它的二维数组排序的方法

 

 代码如下 复制代码
function array_sort($arr,$keys,$type='asc'){
 $keysvalue = $new_array = array();
 foreach ($arr as $k=>$v){
  $keysvalue[$k] = $v[$keys];
 }
 if($type == 'asc'){
  asort($keysvalue);
 }else{
  arsort($keysvalue);
 }
 reset($keysvalue);
 foreach ($keysvalue as $k=>$v){
  $new_array[$k] = $arr[$k];
 }
 return $new_array;
}

它可以对二维数组按照指定的键值进行排序,也可以指定升序或降序排序法(默认为升序),用法示例:

 代码如下 复制代码

$array = array(
 array('name'=>'手机','brand'=>'诺基亚','price'=>1050),
 array('name'=>'笔记本电脑','brand'=>'lenovo','price'=>4300),
 array('name'=>'剃须刀','brand'=>'飞利浦','price'=>3100),
 array('name'=>'跑步机','brand'=>'三和松石','price'=>4900),
 array('name'=>'手表','brand'=>'卡西欧','price'=>960),
 array('name'=>'液晶电视','brand'=>'索尼','price'=>6299),
 array('name'=>'激光打印机','brand'=>'惠普','price'=>1200)
);

$ShoppingList = array_sort($array,'price');
print_r($ShoppingList);

根据我的理解php生成随机密码就是我们把一些要生成的字符预置一个的字符串包括数字拼音之类的以及一些特殊字符,这样我们再随机取字符组成我们想要的随机密码了。

下面总结了一些实例各位朋友可参考。

例1

最简洁的生成方法

 代码如下 复制代码


function generatePassword($length=8)
{
    $chars = array_merge(range(0,9),
                     range('a','z'),
                     range('A','Z'),
                     array('!','@','$','%','^','&','*'));
    shuffle($chars);
    $password = '';
    for($i=0; $i<8; $i++) {
        $password .= $chars[$i];
    }
    return $password;
}


 

例2

1、在 33 – 126 中生成一个随机整数,如 35,
2、将 35 转换成对应的ASCII码字符,如 35 对应 #
3、重复以上 1、2 步骤 n 次,连接成 n 位的密码

 代码如下 复制代码

function create_password($pw_length = 8)
{
    $randpwd = '';
    for ($i = 0; $i < $pw_length; $i++)
    {
        $randpwd .= chr(mt_rand(33, 126));
    }
    return $randpwd;
}

// 调用该函数,传递长度参数$pw_length = 6
echo create_password(6);

实例

 代码如下 复制代码

<?php
mt_srand((double) microtime() * 1000000);
 
function gen_random_password($password_length = 32, $generated_password = ""){
 $valid_characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 $chars_length = strlen($valid_characters) - 1;
 for($i = $password_length; $i--; ) {
  //$generated_password .= $valid_characters[mt_rand(0, $chars_length)];
 
  $generated_password .= substr($valid_characters, (mt_rand()%(strlen($valid_characters))), 1);
 }
 return $generated_password;
}
 
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>php 密码生成器 v 4.0</title>
<style type="text/css">
body {
 font-family: Arial;
 font-size: 10pt;
}
</style>
</head>
<body>
<span style="font-weight: bold; font-size: 15pt;">密码生成器v4.0 by freemouse</span><br /><br />
<?php
 
if (isset($_GET['password_length'])){
 if(preg_match("/([0-9]{1,8})/", $_GET['password_length'])){
  print("密码生成成功:<br />
<span style="font-weight: bold">" . gen_random_password($_GET['password_length']) . "</span><br /><br />n");
 } else {
  print("密码长度不正确!<br /><br />n");
 }
}
 
print <<< end
请为密码生成其指定生成密码的长度:<br /><br />
<form action="{$_SERVER['PHP_SELF']}" method="get">
 <input type="text" name="password_length">
 <input type="submit" value="生成">
</form>
end;
 
?>
</body>
</html>

例4


1、预置一个的字符串 $chars ,包括 a – z,A – Z,0 – 9,以及一些特殊字符
2、在 $chars 字符串中随机取一个字符
3、重复第二步 n 次,可得长度为 n 的密码

 代码如下 复制代码

function generate_password( $length = 8 ) {
    // 密码字符集,可任意添加你需要的字符
    $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';

    $password = '';
    for ( $i = 0; $i < $length; $i++ )
    {
        // 这里提供两种字符获取方式
        // 第一种是使用 substr 截取$chars中的任意一位字符;
        // 第二种是取字符数组 $chars 的任意元素
        // $password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
        $password .= $chars[ mt_rand(0, strlen($chars) - 1) ];
    }

    return $password;
}


上面经过测试性能都不如下面这个

1、预置一个的字符数组 $chars ,包括 a – z,A – Z,0 – 9,以及一些特殊字符
2、通过array_rand()从数组 $chars 中随机选出 $length 个元素
3、根据已获取的键名数组 $keys,从数组 $chars 取出字符拼接字符串。该方法的缺点是相同的字符不会重复取。

 代码如下 复制代码

function make_password( $length = 8 )
{
    // 密码字符集,可任意添加你需要的字符
    $chars = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
    'i', 'j', 'k', 'l','m', 'n', 'o', 'p', 'q', 'r', 's',
    't', 'u', 'v', 'w', 'x', 'y','z', 'A', 'B', 'C', 'D',
    'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L','M', 'N', 'O',
    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y','Z',
    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!',
    '@','#', '$', '%', '^', '&', '*', '(', ')', '-', '_',
    '[', ']', '{', '}', '<', '>', '~', '`', '+', '=', ',',
    '.', ';', ':', '/', '?', '|');

    // 在 $chars 中随机取 $length 个数组元素键名
    $keys = array_rand($chars, $length);

    $password = '';
    for($i = 0; $i < $length; $i++)
    {
        // 将 $length 个数组元素连接成字符串
        $password .= $chars[$keys[$i]];
    }

    return $password;
}

本文章来给各位同学详细介绍关于PHP导出excel类完整实例程序代码,这里我们使用了phpExcel插件哦,大家使用前先去下载一个phpExcel插件。

php exeel.class.php文件

 代码如下 复制代码

<?php

/**
 * Simple excel generating from PHP5
 *
 * @package Utilities
 * @license http://www.opensource.org/licenses/mit-license.php
 * @author Oliver Schwarz <oliver.schwarz@gmail.com>
 * @version 1.0
 */

/**
 * Generating excel documents on-the-fly from PHP5
 *
 * Uses the excel XML-specification to generate a native
 * XML document, readable/processable by excel.
 *
 * @package Utilities
 * @subpackage Excel
 * @author Oliver Schwarz <oliver.schwarz@vaicon.de>
 * @version 1.1
 *
 * @todo Issue #4: Internet Explorer 7 does not work well with the given header
 * @todo Add option to give out first line as header (bold text)
 * @todo Add option to give out last line as footer (bold text)
 * @todo Add option to write to file
 */
class Excel_XML
{

 /**
  * Header (of document)
  * @var string
  */
        private $header = "<?xml version="1.0" encoding="%s"?>n<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">";

        /**
         * Footer (of document)
         * @var string
         */
        private $footer = "</Workbook>";

        /**
         * Lines to output in the excel document
         * @var array
         */
        private $lines = array();

        /**
         * Used encoding
         * @var string
         */
        private $sEncoding;
       
        /**
         * Convert variable types
         * @var boolean
         */
        private $bConvertTypes;
       
        /**
         * Worksheet title
         * @var string
         */
        private $sWorksheetTitle;

        /**
         * Constructor
         *
         * The constructor allows the setting of some additional
         * parameters so that the library may be configured to
         * one's needs.
         *
         * On converting types:
         * When set to true, the library tries to identify the type of
         * the variable value and set the field specification for Excel
         * accordingly. Be careful with article numbers or postcodes
         * starting with a '0' (zero)!
         *
         * @param string $sEncoding Encoding to be used (defaults to UTF-8)
         * @param boolean $bConvertTypes Convert variables to field specification
         * @param string $sWorksheetTitle Title for the worksheet
         */
        public function __construct($sEncoding = 'UTF-8', $bConvertTypes = false, $sWorksheetTitle = 'Table1')
        {
                $this->bConvertTypes = $bConvertTypes;
         $this->setEncoding($sEncoding);
         $this->setWorksheetTitle($sWorksheetTitle);
        }
       
        /**
         * Set encoding
         * @param string Encoding type to set
         */
        public function setEncoding($sEncoding)
        {
         $this->sEncoding = $sEncoding;
        }

        /**
         * Set worksheet title
         *
         * Strips out not allowed characters and trims the
         * title to a maximum length of 31.
         *
         * @param string $title Title for worksheet
         */
        public function setWorksheetTitle ($title)
        {
                $title = preg_replace ("/[\|:|/|?|*|[|]]/", "", $title);
                $title = substr ($title, 0, 31);
                $this->sWorksheetTitle = $title;
        }

        /**
         * Add row
         *
         * Adds a single row to the document. If set to true, self::bConvertTypes
         * checks the type of variable and returns the specific field settings
         * for the cell.
         *
         * @param array $array One-dimensional array with row content
         */
        private function addRow ($array)
        {
         $cells = "";
                foreach ($array as $k => $v):
                        $type = 'String';
                        if ($this->bConvertTypes === true && is_numeric($v)):
                                $type = 'Number';
                        endif;
                        $v = htmlentities($v, ENT_COMPAT, $this->sEncoding);
                        $cells .= "<Cell><Data ss:Type="$type">" . $v . "</Data></Cell>n";
                endforeach;
                $this->lines[] = "<Row>n" . $cells . "</Row>n";
        }

        /**
         * Add an array to the document
         * @param array 2-dimensional array
         */
        public function addArray ($array)
        {
                foreach ($array as $k => $v)
                        $this->addRow ($v);
        }


        /**
         * Generate the excel file
         * @param string $filename Name of excel file to generate (...xls)
         */
        public function generateXML ($filename = 'excel-export')
        {
                // correct/validate filename
                $filename = preg_replace('/[^aA-zZ0-9_-]/', '', $filename);
     
                // deliver header (as recommended in php manual)
                header("Content-Type: application/vnd.ms-excel; charset=" . $this->sEncoding);
                header("Content-Disposition: inline; filename="" . $filename . ".xls"");
                // print out document to the browser
                // need to use stripslashes for the damn ">"
                echo stripslashes (sprintf($this->header, $this->sEncoding));
                echo "n<Worksheet ss:Name="" . $this->sWorksheetTitle . "">n<Table>n";
                foreach ($this->lines as $line)
                        echo $line;

                echo "</Table>n</Worksheet>n";
                echo $this->footer;
        }

}
?>

excel.class.php文件

 代码如下 复制代码

<?php
/*功能:导出excel类
 *时间:2012年8月16日
 *作者:565990136@qq.com
*/
class myexcel{
private $filelds_arr1=array();
private $filelds_arr2=array();
private $filename;
// load library
function __construct($fields_arr1,$fields_arr2,$filename='test'){
 $this->filelds_arr1=$fields_arr1;
 $this->filelds_arr2=$fields_arr2;
 $this->filename=$filename;
 }
function putout(){
require 'php-excel.class.php';

$datavalue=$this->filelds_arr2;
$newdata[0]=$this->filelds_arr1;
$arrcount=count($datavalue);
for($i=1;$i<=$arrcount;$i++){
$newdata[$i]=array_values($datavalue[$i-1]);
}


$filename=$this->filename;
$xls = new Excel_XML('UTF-8', false, 'My Test Sheet');
$xls->addArray($newdata);
$xls->generateXML($filename);
}
}

/*
**用法示例(注意导出的文件名只能用英文)

  $asdasd=new myexcel(array('姓名','电话'),array(array('贾新明','13521530320')),'abc');
  $asdasd->putout();
*/
?>

注意,我们把上面的代码分别保存成两个文件再进行操作。

文章来给各位同学介绍在PHP命令行执行PHP脚本的注意事项总结,如果你不注意这些东西,很可能服务器安全就出问题哦。

如果你使用的wamp集成安装环境的话,那么你php的配置是在D:/wamp/bin/apache/Apache2.2.17/bin
你要先把他复制覆盖掉D:/wamp/bin/php/php5.3.3下的php.ini,否则当你调用扩展函数的时候会报错误如:Fatal error: Call to undefined function

如果你懒得写那么大长串php的路径,你也可以把D:/wamp/bin/php/php5.3.3加到环境变量path里面。
另外关于传参的问题。 比如我要执行test.php?a=123
命令行中我们就可以写 php test.php 123
在test.php中使用$argv[1]来接收123.

建一个简单的文本文件,其中包含有以下PHP代码,并把它保存为hello.php:

 代码如下 复制代码

<?php
echo "Hello from the CLI";
?>

现在,试着在命令行提示符下运行这个程序,方法是调用CLI可执行文件并提供脚本的文件名:

 代码如下 复制代码
#php phphello.php
输出Hello from the CLI

附上一个bat的可执行文件作为参考

 代码如下 复制代码

@echo off

php D:/wamp/www/taobao/items.php 158345687

php D:/wamp/www/taobao/refunds_up.php 158345687

php D:/wamp/www/taobao/trade.php 158345687

echo.&echo 请按任意键关闭BAT窗口...&pause

exit


一些常用的执行命令的代码

下是 PHP 二进制文件(即 php.exe 程序)提供的命令行模式的选项参数,您随时可以通过 PHP -h 命令来查询这些参数。
Usage: php [options] [-f] <file> [args...]
       php [options] -r <code> [args...]
       php [options] [-- args...]
  -s               Display colour syntax highlighted source.
  -w               Display source with stripped comments and whitespace.
  -f <file>        Parse <file>.
  -v               Version number
  -c <path>|<file> Look for php.ini file in this directory
  -a               Run interactively
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -z <file>        Load Zend extension <file>.
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -i               PHP information
  -r <code>        Run PHP <code> without using script tags <?..?>
  -h               This help
 
  args...          Arguments passed to script. Use -- args when first argument
                   starts with - or script is read from stdin

CLI SAPI 模块有以下三种不同的方法来获取您要运行的 PHP 代码:

  在windows环境下,尽量使用双引号, 在linux环境下则尽量使用单引号来完成。


1.让 PHP 运行指定文件。

 代码如下 复制代码

php my_script.php
 
php -f  "my_script.php"

以上两种方法(使用或不使用 -f 参数)都能够运行给定的 my_script.php 文件。您可以选择任何文件来运行,您指定的 PHP 脚本并非必须要以 .php 为扩展名,它们可以有任意的文件名和扩展名。

2.在命令行直接运行 PHP 代码。

 代码如下 复制代码

php -r "print_r(get_defined_constants());"

在使用这种方法时,请您注意外壳变量的替代及引号的使用。

注: 请仔细阅读以上范例,在运行代码时没有开始和结束的标记符!加上 -r 参数后,这些标记符是不需要的,加上它们会导致语法错误。

3.通过标准输入(stdin)提供需要运行的 PHP 代码。

以上用法给我们提供了非常强大的功能,使得我们可以如下范例所示,动态地生成 PHP 代码并通过命令行运行这些代码:

 代码如下 复制代码

$ some_application | some_filter | php | sort -u >final_output.txt

[!--infotagslink--]

相关文章

  • 图解PHP使用Zend Guard 6.0加密方法教程

    有时为了网站安全和版权问题,会对自己写的php源码进行加密,在php加密技术上最常用的是zend公司的zend guard 加密软件,现在我们来图文讲解一下。 下面就简单说说如何...2016-11-25
  • ps怎么使用HSL面板

    ps软件是现在很多人都会使用到的,HSL面板在ps软件中又有着非常独特的作用。这次文章就给大家介绍下ps怎么使用HSL面板,还不知道使用方法的下面一起来看看。 &#8195;...2017-07-06
  • Plesk控制面板新手使用手册总结

    许多的朋友对于Plesk控制面板应用不是非常的了解特别是英文版的Plesk控制面板,在这里小编整理了一些关于Plesk控制面板常用的使用方案整理,具体如下。 本文基于Linu...2016-10-10
  • 使用insertAfter()方法在现有元素后添加一个新元素

    复制代码 代码如下: //在现有元素后添加一个新元素 function insertAfter(newElement, targetElement){ var parent = targetElement.parentNode; if (parent.lastChild == targetElement){ parent.appendChild(newEl...2014-05-31
  • 使用GruntJS构建Web程序之构建篇

    大概有如下步骤 新建项目Bejs 新建文件package.json 新建文件Gruntfile.js 命令行执行grunt任务 一、新建项目Bejs源码放在src下,该目录有两个js文件,selector.js和ajax.js。编译后代码放在dest,这个grunt会...2014-06-07
  • 使用percona-toolkit操作MySQL的实用命令小结

    1.pt-archiver 功能介绍: 将mysql数据库中表的记录归档到另外一个表或者文件 用法介绍: pt-archiver [OPTION...] --source DSN --where WHERE 这个工具只是归档旧的数据,不会对线上数据的OLTP查询造成太大影响,你可以将...2015-11-24
  • 如何使用php脚本给html中引用的js和css路径打上版本号

    在搜索引擎中搜索关键字.htaccess 缓存,你可以搜索到很多关于设置网站文件缓存的教程,通过设置可以将css、js等不太经常更新的文件缓存在浏览器端,这样访客每次访问你的网站的时候,浏览器就可以从浏览器的缓存中获取css、...2015-11-24
  • jQuery 1.9使用$.support替代$.browser的使用方法

    jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.support 。 在更新的 2.0 版本中,将不再支持 IE 6/7/8。 以后,如果用户需要支持 IE 6/7/8,只能使用 jQuery 1.9。 如果要全面支持 IE,并混合...2014-05-31
  • C#注释的一些使用方法浅谈

    C#注释的一些使用方法浅谈,需要的朋友可以参考一下...2020-06-25
  • MySQL日志分析软件mysqlsla的安装和使用教程

    一、下载 mysqlsla [root@localhost tmp]# wget http://hackmysql.com/scripts/mysqlsla-2.03.tar.gz--19:45:45-- http://hackmysql.com/scripts/mysqlsla-2.03.tar.gzResolving hackmysql.com... 64.13.232.157Conn...2015-11-24
  • 安装和使用percona-toolkit来辅助操作MySQL的基本教程

    一、percona-toolkit简介 percona-toolkit是一组高级命令行工具的集合,用来执行各种通过手工执行非常复杂和麻烦的mysql和系统任务,这些任务包括: 检查master和slave数据的一致性 有效地对记录进行归档 查找重复的索...2015-11-24
  • php语言中使用json的技巧及json的实现代码详解

    目前,JSON已经成为最流行的数据交换格式之一,各大网站的API几乎都支持它。我写过一篇《数据类型和JSON格式》,探讨它的设计思想。今天,我想总结一下PHP语言对它的支持,这是开发互联网应用程序(特别是编写API)必须了解的知识...2015-10-30
  • PHP实现无限级分类(不使用递归)

    无限级分类在开发中经常使用,例如:部门结构、文章分类。无限级分类的难点在于“输出”和“查询”,例如 将文章分类输出为<ul>列表形式; 查找分类A下面所有分类包含的文章。1.实现原理 几种常见的实现方法,各有利弊。其中...2015-10-23
  • php类的使用实例教程

    php类的使用实例教程 <?php /** * Class program for yinghua05-2 * designer :songsong */ class Template { var $tpl_vars; var $tpl_path; var $_deb...2016-11-25
  • PHP分布式框架如何使用Memcache同步SESSION教程

    本教程主要讲解PHP项目如何用实现memcache分布式,配置使用memcache存储session数据,以及memcache的SESSION数据如何同步。 至于Memcache的安装配置,我们就不讲了,以前...2016-11-25
  • 使用jquery修改表单的提交地址基本思路

    基本思路: 通过使用jquery选择器得到对应表单的jquery对象,然后使用attr方法修改对应的action 示例程序一: 默认情况下,该表单会提交到page_one.html 点击button之后,表单的提交地址就会修改为page_two.html 复制...2014-06-07
  • 双冒号 ::在PHP中的使用情况

    前几天在百度知道里面看到有人问PHP中双冒号::的用法,当时给他的回答比较简洁因为手机打字不大方便!今天突然想起来,所以在这里总结一下我遇到的双冒号::在PHP中使用的情况!双冒号操作符即作用域限定操作符Scope Resoluti...2015-11-08
  • 浅析Promise的介绍及基本用法

    Promise是异步编程的一种解决方案,在ES6中Promise被列为了正式规范,统一了用法,原生提供了Promise对象。接下来通过本文给大家介绍Promise的介绍及基本用法,感兴趣的朋友一起看看吧...2021-10-21
  • PHP mysql与mysqli事务使用说明 分享

    mysqli封装了诸如事务等一些高级操作,同时封装了DB操作过程中的很多可用的方法。应用比较多的地方是 mysqli的事务。...2013-10-02
  • Postman安装与使用详细教程 附postman离线安装包

    这篇文章主要介绍了Postman安装与使用详细教程 附postman离线安装包,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下...2021-03-05