随笔分类 - php
摘要:<?php //单例模式:例如只有一个db类的时候保证只new一次 //第一步:普通类 class sigle{ protected static $ins = null(); //第二步:封锁 new 操作 public static function getIns(){ if(self ::$i
阅读全文
摘要:<?php interface db{ function conn(); } interface Factory{ function createDB(); } class dbmysql implements db{ public function conn(){ echo ''; } } cla
阅读全文
摘要:<?php // 抽象类:抽象方法只能声明,不能有方法体,允许通过继承来实例化。(可以有普通方法) // 接口类:只能声明,不能有方法体,允许通过继承来实例化。 abstract class Tiger{ public abstract function clime(); } class XTige
阅读全文
摘要:server { l isten 80; listen [::]:80; server_name www.50.com; root /var/www/50vue/public; location / { #index index.html; if (!-e $request_filename){ r
阅读全文
摘要://************************** 图片加文字 ************************ $dst_path = '11.jpg';//创建图片的实例$dst = imagecreatefromstring(file_get_contents($dst_path));/
阅读全文
摘要:import('/Doctor.Logic.phpqrcode',APP_PATH,'.php');// import('@.Doctor.Logic');$value = 'http://www.cnblogs.com/txw1958/'; //二维码内容 $errorCorrectionLeve
阅读全文
摘要:<?php $redis = new \Redis(); $redis->connect('127.0.0.1',6379); $password = '123456'; $redis->auth($password); //redis进行密码验证 $arr = array('h','e','l',
阅读全文
摘要://获取32位随机字符串 $randTocke = getRandChar($length); //当前脚本运行时间, 单位为十万分之一毫秒 $timestamp = $_SERVER['REQUEST_TIME_FLOAT']; //盐(自定义字符串,加密用) $sale = config('se
阅读全文
摘要:public function dd(){ error_reporting(E_ALL^E_NOTICE^E_WARNING);$arr1 = array(0,1,2,3,4,5,6,7,8,9);$arr2 = array(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s
阅读全文
摘要:// <span style="white-space:pre"> </span>//因为要把产生的验证码保存到session中,此处为session开始 session_start(); //创建一张宽100高30的图像 $image = imagecreatetruecolor(100, 30)
阅读全文
摘要:安装laravel之前先安装composer 使用 curl 指令下载: curl -sS https://getcomposer.org/installer | php 或是沒有安裝 curl ,也可以用 php 指令下载: php -r "readfile('https://getcompose
阅读全文
摘要:mod_php 1.是apache的附属包,apache死掉后php也会死掉 2.稳定性差,php出错服务器进程也会受影响 php-fpm 1.和nginx是两个独立的个体。 2.php-fpm在php出错时启动新的php_fpm 进程(打开ps -ef | grep php-fpm 查看:mast
阅读全文
摘要:public function file_get_contents_post($url, $post){ $options = array( 'http'=> array( 'method'=>'POST', 'content'=> http_build_query($post), ), ); $r
阅读全文
摘要:echo 'SERVER_NAME:'.$_SERVER['SERVER_NAME']; //获取当前域名(不含端口号) echo '<p>'; echo 'HTTP_HOST:'.$_SERVER['HTTP_HOST'];//获取当前域名 (含端口号) echo '<p>'; echo 'REQ
阅读全文
摘要:$code = '400 Bad Request'; header('HTTP/1.1 '.$code);
阅读全文
摘要:php: function __construct(){ // 指定允许其他域名访问 header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Credentials: true"); header("Access-
阅读全文
摘要:[1] 安装PHP. [root@linuxprobe ~]# yum -y install php php-mbstring php-pear [root@linuxprobe ~]# vi /etc/php.ini # line 878: 取消注释,设置时区 date.timezone = "A
阅读全文
摘要:<?php namespace Doctor\Controller; use Think\Controller; class OldTrusteeshipController extends Controller {/* * 抓取页面 */ public function index() { $ur
阅读全文
摘要:WampServer 集成环境(懒人程序)一键安装 1.Windows 2.Apache 3.Mysql 4.php
阅读全文
浙公网安备 33010602011771号