PHP has several special keywords, such as echo, print, die, require, and so on, although they work like functions, they are actually more like if, while such as control statements, rather than a function. In other words, when the interpreter
Code:
Copy Code code as follows:
Eval ("Echo ' Hello World;");
The top code is equivalent to the following code:
echo "Hello World";
Output in the browser: Hello World
Use eval () to note several points:
The string at
PHP recursive function in the use of return when you can not correctly returned to the desired situation, if you do not understand the reasons, it is difficult to find the wrong, the following specific examples to illustrate it:
Copy Code code
Tonight, when writing a form validation class for a framework, you need to determine whether a string length is within a specified range, and naturally, think of the strlen function in PHP.
Copy Code code as follows:
$str = ' Hello
One, how to disable Fsockopen () The following are two common methods for disabling Fsockopen. 1, modify php.ini, add disable_functions = add fsockopen 2, modify php.ini, Allow_url_ fopen = on changed to allow_url_fopen = off
Ii. How
Copy Code code as follows:
@ Get the sub-column ID number
Private Function Soncategoryids ($categoryID)
{
@ Initialize column array
$array [] = $categoryID;
Todo
{
$ids = ';
$temp = $this->mysql->select (' Select ' id '
Recently in the project, there is a strange phenomenon, there is a large form with thousands of input, the time to submit, always find the post data incomplete, at the beginning of the suspect is the HTML form name conflict, ruled out.Then, on the
When debugging open source code, you want to see the definition of a function, you need to locate its location. In an IDE like Zend Studio, you can automatically prompt, but what can we do when there is no such development tool installed? Refer to
With reference to PHP (the role of & symbol in front of a variable or function, object, etc.), let's look at the following procedure.
Copy Code code as follows:
$a = 100; Declaring variable A
$b = & $a; Declaring variable B,
1, if you can define the method of the class as static, as far as possible to define static, it will increase the speed of nearly 4 times times.2, $row [' ID '] speed is $row[id] 7 times times.3, ECHO is faster than print, and uses Echo's multiple
In PHP, include () and require () have the same functionality, include (include_once) and require (require_once) are to read the included file code into the specified location, But there is a difference between the two: (Include () is a conditional
VLD IntroductionVLD is a php extension of pecl (PHP extension and application repository), and now the latest version is 0.14.0(2016-12-18), which is to display the internal representation of the dump PHP script (opcode) ( Introduction to VLD from
There are a lot of solutions available on the Internet to solve, and now share the following:Win7 64-bit system, apache24,php5.6.6.In addition to the php.ini; Extension=php_curl.dll in front of the ";" removed, the following actions are required,I
/Etc/php-fpm.d/www. conf configuration notes, php-fpm.dwww.conf
1. The rlimit_files value in the php-fpm configuration file must be consistent with the number of open connections of the system.
1) view the number of opened system files
[Root @
Use OpenSSL in PHP to generate certificates and encrypt and decrypt, and use openssl to encrypt and decrypt
Depends on OpenSSL Extension
/* Encryption and decryption */function authcode ($ string, $ operation = 'E') {$ ssl_public = file_get_contents
Description of the get_magic_quotes_gpc () function in php, getmagicquotesgpc
The get_magic_quotes_gpc function is used to determine whether to add a slash to the data provided by the user. This is in the php. ini configuration file. Next I will
Example of a function for bringing the correlated field to search and sort in the Yii2-GridView, yii2gridview sorting
Situation requirements:
To display the Customer name in the Order view's gridview, and make it have the same sorting and search
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service