php加密,最早接触的是php5.3版本,zend的加密技术。解密还要安装扩展运行,解密后的代码不可运行。 php目前官方介绍了几种加密扩展: crack扩展,官方目前不扩绑在php中, caprng扩展,目前支持5.2以上版本, hash扩展, mcrypt扩展,php7.1.0废除,php7.2.0会移到pecl, mhash扩展, openssl扩展,opessl库来对称/非对称加解密,以及 PBKDF2、 PKCS7、 PKCS12、 X509 和其他加密操作, 密码散列算法 API 提供了简单易用的 crypt() 包装, 以一种简洁易用安全的方式创建和管理密码。 网友给出的加密技术: md5加密, crypt加密算法, sha1加密算法, url编码加密技术, Base64信息编码加密。 加密扩展呢,在官方文档里有介绍使用方法,这个大家自己可以去看看。 具体不详细介绍,参考php官方文档http://php.net/manual/zh/
最新文章
PHP encryption — the first thing I came across was Zend’s encryption technology back in PHP 5.3. To decrypt you also had to install an extension to run it, and the decrypted code would not run. PHP currently officially introduces several encryption extensions: the crack extension, which is currently not bundled into php by the official build, the caprng extension, which currently supports versions above 5.2, the hash extension, the mcrypt extension, which was deprecated in php7.1.0 and will be moved to pecl in php7.2.0, the mhash extension, the openssl extension, which uses the openssl library for symmetric/asymmetric encryption and decryption, as well as PBKDF2, PKCS7, PKCS12, X509 and other cryptographic operations, and the password hashing algorithm API, which provides a simple, easy-to-use wrapper around crypt(), creating and managing passwords in a concise, easy-to-use and secure way. Encryption techniques suggested by netizens: md5 encryption, the crypt encryption algorithm, the sha1 encryption algorithm, URL encoding encryption, and Base64 information encoding. As for the encryption extensions, their usage is explained in the official documentation, and you can go take a look for yourselves. I won’t go into detail here — refer to the official php documentation http://php.net/manual/zh/
最近公司招聘新员工,面试中有提到会话原理,我懵了一下。 会话原理是什么? 首先解释一下什么是会话。在计算机术语中,会话是指一个终端用户与交互系统进行通讯的过程,比如从输入账户密码进入操作系统到退出操作系统就是一个会话过程。会话较多用于网络上,TCP的三次握手就创建了一个会话,TCP关闭连接就是关闭会话。用平述的语言可以解释为:你拔打你女友的电话号码,你女友接听,然后一翻“亲爱的”,直到任何一方挂掉电话,这个过程就是一个会话。你挑逗一只小狗,它跟你互动,也是会话;它不鸟你,那就不形成会话。 这不是就是服务端与用户端的通信,或者说用户端登录服务端的认证。 她可以使服务器间的通信,浏览器与网站的通信…… 可以用传统的cookie、session机制实现。也可以用令牌认证实现。这其中包含:创建会话 、认证会话 、获取会话信息、会话时长限制、销毁会话。 通俗的就是一个用户登录到一网站,并浏览网站数据,然后离开的过程。 其实,就是登录认证服务。
Recently our company was hiring new employees, and the principle of sessions came up during an interview — I blanked for a moment. What exactly is the principle of sessions? First, let me explain what a session is. In computer terminology, a session refers to the process of communication between an end user and an interactive system; for example, going from typing in an account and password to enter an operating system all the way to logging out of the operating system is one session. Sessions are more commonly used on networks: TCP’s three-way handshake creates a session, and closing a TCP connection closes the session. In plain language you could explain it like this: you dial your girlfriend’s phone number, your girlfriend answers, and then there’s a round of “dear…” until either side hangs up — that whole process is a session. You tease a puppy and it interacts with you, and that is also a session; if it ignores you, then no session is formed. Isn’t this just communication between the server and the client, or in other words the client authenticating by logging into the server? It can enable communication between servers, communication between a browser and a website… It can be implemented with the traditional cookie and session mechanisms. It can also be implemented with token authentication. This includes: creating a session, authenticating a session, retrieving session information, session duration limits, and destroying a session. In everyday terms, it is the process of a user logging into a website, browsing the website’s data, and then leaving. In fact, it is just a login authentication service.
Composer is a dependency management tool for PHP 5.3 and above. Simply put, in Composer you can find all kinds of excellent third-party extensions. It can enrich your project and save development time.
First you need to install Composer on your local Windows machine.
Once the installation succeeds, use a command window to install it — open the directory and run: echo @php “%~dp0composer.phar” %*>composer.bat
Close the command window and reopen it, then run: composer. The result is shown in the figure.
夜出鹏城宿羊南, 千里粤豫一日还。 九朝帝王今何在, 洛水小巷今荣繁。 写于2017年春节归途。
By night I leave Pengcheng, to lodge south of Yang; a thousand li from Yue to Yu in a single day. Where now are the emperors of nine dynasties? The lanes by the Luo River thrive today. Written on the road home for the 2017 Spring Festival.
最近需要套个模板,当然模板不需去购买。那就抓取一个,百度一下发现wget是个不错的用法。
wget -r -p -np -k https://erik.xyz 就可抓取整个站点模板到本地。
然后打包压缩,拷贝到win电脑就可以修修改改。
顺便查查wget使用方法
-a<日志文件>:在指定的日志文件中记录资料的执行过程;
-A<后缀名>:指定要下载文件的后缀名,多个后缀名之间使用逗号进行分隔;
-b:进行后台的方式运行wget;
Recently I needed to adapt a template, and of course I wasn’t going to buy one. So I’d scrape one instead — a quick search turned up wget as a pretty good way to do it.
wget -r -p -np -k https://erik.xyz and you can scrape the whole site’s template to your local machine.
Then package it up, compress it, copy it to a Windows machine and you can tinker with it as you like.
While I was at it I looked up how to use wget
-a
-A
-b: run wget in the background;
在官方pecl库中只能找到支持5.2版本的sphinx扩展。php7出来好一段时间了,没有sphinx不太科学。根据网友给的提提示,在pecl库下的sphinx页面中,点击[ Browse Source ] 如下图:
In the official pecl repository you can only find a Sphinx extension that supports version 5.2. PHP 7 has been out for quite a while, and having no Sphinx isn’t very reasonable. Following a tip from a fellow netizen, on the sphinx page under the pecl repository, click [ Browse Source ] as shown below:
本文转载自:http://www.scutephp.com/topic-id1325.html 收集整理一些常用的PHP类库, 资源以及技巧. 以便在工作中迅速的查找所需… 
学习资源
php相关的有参考价值的社区,博客,网站,文章,书籍,视频等资源
- PHP网站(PHP Websites)
- PHP The Right Way 一个PHP实践的快速参考指导
- PHP书籍(PHP Books)
- Modern PHP - 作者是PHP 之道的发起人和Slim框架的作者
This article is reposted from: http://www.scutephp.com/topic-id1325.html A collection of commonly used PHP libraries, resources and tips, so you can quickly find what you need at work… 
Learning Resources
Valuable php-related resources for reference: communities, blogs, websites, articles, books, videos and so on
- PHP Websites
- PHP The Right Way A quick reference guide to PHP practices
- PHP Books
- Modern PHP - by the founder of PHP The Right Way and the author of the Slim framework
1 | public function xmlArray($xml){ |
1 | public function xmlArray($xml){ |
- 基本类型
- integer 整型 表示整数
- float 浮点数 双精度值,表示所有实数
- string 字符串 表示字符串
- boolean 布尔值 表示true或false
- array 数组 保存具有相同类型的多个数据项
- object 对象 保存类的实例 特殊类型
- NULL 空 没有被赋值、已经被重置或者被赋值为特殊值NULL的变量就是NULL类型的变量
- resource 资源 特定内置函数(例如数据库函数)将返回resource类型的变量 必须作为参数传递给其他函数
- Basic types
- integer — integer type, represents whole numbers
- float — floating point, double-precision values, represents all real numbers
- string — string type, represents strings
- boolean — boolean, represents true or false
- array — array, holds multiple data items of the same type
- object — object, holds an instance of a class; a special type
- NULL — null, a variable that has not been assigned a value, has been reset, or has been assigned the special value NULL is a variable of the NULL type
- resource — resource, specific built-in functions (for example database functions) return variables of the resource type; they must be passed as arguments to other functions
引用操作符 & 引用操作符主要用在关联赋值中,一个变量赋值给另一个变量的时候,先产生原变量的副本,然后再将副本保存在内存中。
例如: $a=1; $b=$a; echo $b; 结果为 1
如果 $a=2; 则 echo $b; 结果还是 1 。
因为$a的赋值副本依然在内存中,赋值依然是第一个值的副本。 这样就用引用操作符 & ,引用操作符会重置原来的指向地址。
The reference operator & — the reference operator is mainly used in associative assignment. When one variable is assigned to another variable, a copy of the original variable is produced first, and then that copy is saved in memory.
For example: $a=1; $b=$a; echo $b; the result is 1
If $a=2; then echo $b; the result is still 1 .
Because the copy assigned to $a is still in memory, the assignment is still a copy of the first value. So we use the reference operator &, which resets the original address being pointed to.