随笔分类 -  php

摘要:<?php //单例模式:例如只有一个db类的时候保证只new一次 //第一步:普通类 class sigle{ protected static $ins = null(); //第二步:封锁 new 操作 public static function getIns(){ if(self ::$i 阅读全文
posted @ 2021-11-16 17:46 让双脚&去腾空 阅读(39) 评论(0) 推荐(0)
摘要:<?php interface db{ function conn(); } interface Factory{ function createDB(); } class dbmysql implements db{ public function conn(){ echo ''; } } cla 阅读全文
posted @ 2021-11-16 16:33 让双脚&去腾空 阅读(37) 评论(0) 推荐(0)
摘要:<?php // 抽象类:抽象方法只能声明,不能有方法体,允许通过继承来实例化。(可以有普通方法) // 接口类:只能声明,不能有方法体,允许通过继承来实例化。 abstract class Tiger{ public abstract function clime(); } class XTige 阅读全文
posted @ 2021-11-16 15:25 让双脚&去腾空 阅读(31) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-10-18 16:17 让双脚&去腾空 阅读(51) 评论(0) 推荐(0)
摘要://************************** 图片加文字 ************************ $dst_path = '11.jpg';//创建图片的实例$dst = imagecreatefromstring(file_get_contents($dst_path));/ 阅读全文
posted @ 2019-02-21 10:27 让双脚&去腾空 阅读(218) 评论(0) 推荐(0)
摘要:import('/Doctor.Logic.phpqrcode',APP_PATH,'.php');// import('@.Doctor.Logic');$value = 'http://www.cnblogs.com/txw1958/'; //二维码内容 $errorCorrectionLeve 阅读全文
posted @ 2018-10-23 14:03 让双脚&去腾空 阅读(444) 评论(0) 推荐(0)
摘要:<?php $redis = new \Redis(); $redis->connect('127.0.0.1',6379); $password = '123456'; $redis->auth($password); //redis进行密码验证 $arr = array('h','e','l', 阅读全文
posted @ 2018-08-05 21:14 让双脚&去腾空 阅读(408) 评论(0) 推荐(0)
摘要://获取32位随机字符串 $randTocke = getRandChar($length); //当前脚本运行时间, 单位为十万分之一毫秒 $timestamp = $_SERVER['REQUEST_TIME_FLOAT']; //盐(自定义字符串,加密用) $sale = config('se 阅读全文
posted @ 2018-08-04 17:00 让双脚&去腾空 阅读(337) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2018-07-20 11:43 让双脚&去腾空 阅读(219) 评论(0) 推荐(0)
摘要:// <span style="white-space:pre"> </span>//因为要把产生的验证码保存到session中,此处为session开始 session_start(); //创建一张宽100高30的图像 $image = imagecreatetruecolor(100, 30) 阅读全文
posted @ 2018-07-20 11:42 让双脚&去腾空 阅读(291) 评论(0) 推荐(0)
摘要:安装laravel之前先安装composer 使用 curl 指令下载: curl -sS https://getcomposer.org/installer | php 或是沒有安裝 curl ,也可以用 php 指令下载: php -r "readfile('https://getcompose 阅读全文
posted @ 2018-07-10 17:23 让双脚&去腾空 阅读(2189) 评论(0) 推荐(0)
摘要:mod_php 1.是apache的附属包,apache死掉后php也会死掉 2.稳定性差,php出错服务器进程也会受影响 php-fpm 1.和nginx是两个独立的个体。 2.php-fpm在php出错时启动新的php_fpm 进程(打开ps -ef | grep php-fpm 查看:mast 阅读全文
posted @ 2018-01-31 10:27 让双脚&去腾空 阅读(1176) 评论(0) 推荐(0)
摘要:public function file_get_contents_post($url, $post){ $options = array( 'http'=> array( 'method'=>'POST', 'content'=> http_build_query($post), ), ); $r 阅读全文
posted @ 2018-01-29 10:26 让双脚&去腾空 阅读(114) 评论(0) 推荐(0)
摘要:echo 'SERVER_NAME:'.$_SERVER['SERVER_NAME']; //获取当前域名(不含端口号) echo '<p>'; echo 'HTTP_HOST:'.$_SERVER['HTTP_HOST'];//获取当前域名 (含端口号) echo '<p>'; echo 'REQ 阅读全文
posted @ 2018-01-29 10:23 让双脚&去腾空 阅读(1361) 评论(0) 推荐(0)
摘要:$code = '400 Bad Request'; header('HTTP/1.1 '.$code); 阅读全文
posted @ 2018-01-29 10:06 让双脚&去腾空 阅读(2127) 评论(0) 推荐(0)
摘要:php: function __construct(){ // 指定允许其他域名访问 header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Credentials: true"); header("Access- 阅读全文
posted @ 2018-01-24 10:28 让双脚&去腾空 阅读(134) 评论(0) 推荐(0)
摘要:[1] 安装PHP. [root@linuxprobe ~]# yum -y install php php-mbstring php-pear [root@linuxprobe ~]# vi /etc/php.ini # line 878: 取消注释,设置时区 date.timezone = "A 阅读全文
posted @ 2018-01-23 22:08 让双脚&去腾空 阅读(177) 评论(0) 推荐(0)
摘要:<?php namespace Doctor\Controller; use Think\Controller; class OldTrusteeshipController extends Controller {/* * 抓取页面 */ public function index() { $ur 阅读全文
posted @ 2017-10-09 11:24 让双脚&去腾空 阅读(143) 评论(0) 推荐(0)
摘要:WampServer 集成环境(懒人程序)一键安装 1.Windows 2.Apache 3.Mysql 4.php 阅读全文
posted @ 2017-02-06 16:37 让双脚&去腾空 阅读(89) 评论(0) 推荐(0)