Solution for missing phpinfo extension in lnmp1.4 environment, lnmp1.4phpinfo
When laravel is deployed in an environment installed using the lnmp one-click installation package, the missing fileinfo extension error message is displayed.
Solution:
In a user-defined function, a local function range is introduced. By default, any variable used in a function is limited to a local function.
The code is as follows:
$ A = 1;Include 'B. Inc ';?>
The variable $ a will take effect in the
Php gets the first letter of Chinese characters and pinyin. you can test it on your own. Php obtains the first letter of Chinese Pinyin
The code is as follows:
Function getinitial ($ str){$ Asc = ord (substr ($ str, 0, 1 ));If ($ asc {If ($ asc >
Difference between $ _ SERVER [PHP_SELF] and $ _ SERVER [SCRIPT_NAME] in php: "PHP_SELF"
The file name of the script being executed, which is related to document root. For example, using $ _ SERVER ['php _ SELF '] in a script with a URL address of
The string lengths of different php codes are differentiated. The following is some test code. For more information, see.
The Chinese character string for the UTF-8 is three bytes
The code is as follows:
// Coding UTF-8Echo strlen ('test text
Some functions called Magic methods in PHP are introduced here: in fact, they are used in common applications !! After PHP5.0, php provides more object-oriented methods to make php more powerful !!
Some functions called Magic methods in PHP are
For the side effects of PHP string comparison operators, refer.
The code is as follows:
$ A = '000000 ';$ B = '000000 ';Var_dump ($ a = $ B );
The output of this code is bool (true), indicating that the two are equal. similar features are
Php member variables can be initialized at the same time as they are declared, but only scalar variables can be initialized. For example:
Class {
Public $ f1 = 'xxxx ';
Static public $ f2= 100;
}
If you want to assign a variable to an
The cache application implementation code in the smarty template engine in php. For more information, see.
1. Smarty cache configuration:
The code is as follows:
$ Smarty-> cache-dir = "directory name"; // create a cache directory name$ Smarty->
The implementation code of the image text watermark and thumbnail in php. For more information, see. ImageCreateFrom * image loading function
// Image with different suffix
It is generally because of an eaccelerator problem, which may occur in windows. When I set up wordpress, I found that this kind of error was reported. The online solutions are all copy and paste, all of which are about eaccelerator settings. I am
Because of this problem, I went to Google to search for it. 1. php-excel
Php-excel is a very simple library for generating excel documents from php on-the-fly.
Http://code.google.com/p/php-excel/Download
The process analysis of Zendframework processing an http request helps you improve your knowledge.
1. the first step is the bootstrap process, which initializes the resources used in the program.
2. create a Zend_Controller_Front object to
In the search function, $ array is the array, $ k is the value to be searched, $ low is the minimum key value in the search range, and $ high is the maximum key value in the search range.
The code is as follows:
// In the search function, $
If the previous result is false, the operation is not executed. if the result is true, continue with the following operations. Example:
! Defined ('Magic _ QUOTES_GPC ') & define ('Magic _ QUOTES_GPC', get_magic_quotes_gpc ());
O (zookeeper) o Alas,
Code http://code.google.com/apis/ajaxsearch/documentation/#fonje for retrieving GoogleAJAXSearchAPI data with PHP
The code is as follows:
// This example request has des an optional API key which you will need// Remove or replace with your own
There are not many resources for PHP extension, so this friend should be a master. He shared his experiences in practice. The red part is my comment.
For more information, see:
1. Common features have been encapsulated. in the header file such as
10 of PHP functions, although uncommon, are very useful. if you have special requirements, take full advantage of php.
1. sys_getloadavg ()
Sys_getloadavt () can obtain the system load. This function returns an array containing three elements, each
Foreach is another solution for processing loops except section (different solutions are selected based on different needs ). Foreach is used to process a simple array (the element types in the array are the same). Its format is much simpler than
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