I. Installation memcache extensions First we check our current PHP environment for memcache extensions with the Phpinfo () function. Create a new file info.php in the root directory of the server, write in the file addsever ('
Filter_var (): Filters a single variable Filter_var (variable,filter,options) via a specified filter: Variable required, filter optional, options specify an array containing the logo/option. Check the possible flags and options for each filter.
In the process of learning thinkphp, need to operate on more than one table, but in the actual process, always encounter a variety of problems, so write this blog, as their learning process in the course of the operation, the two tables query is
When PHP accepts information submitted through an HTML form, it saves the submitted data in a global array, and we can get the values by calling the system-specific array of automatic global variables. The common automatic global variables are as
Str_replace
(PHP 4, PHP 5)
Str_replace-replace all occurrences to the search string with the replacement string
DescriptionMixed Str_replace (mixed
$search, mixed
$replace, mixed
$subject[, int
&$count] )
This function returns a string or "an
Foreach (PHP 4, PHP 5) The foreach construct provides an easy way to iterate over arrays. foreach works is on arrays and objects, and'll issue an error while you try to use it in a variable with a different Da TA type or an uninitialized variable.
Recently began to learn thinkphp, in the next, a lot of problems can not understand so want to take out, I dare to send on the home page, I hope to see people can answer questions for me, so that everyone has an interaction, learn to quickly, do not
PHP has a super global variable $globals that is not used by many people. The rational use of this variable can make the work more efficient, this article mainly analyzes the use of the Super global variable and the difference between $globals and
Well, I don't really care about the amount of traffic, but I have more visits today than I did last year.
I'm still a little surprised. As a technology of the cock silk. No, I don't think I'm a dick, I think programming is a tall mountain career.
A recent project on the timeline, giving a start time and an end time, you need to list the dates in this time period and also determine how many weeks. After research, come up with the following methods, and we share, to facilitate the need for
Recently, as a result of the project requirements to do a statistical function, the current date before the first 30 days of records. function quite simple, the following will be the realization of the method and share with you, to facilitate the
Arrays are often used in PHP, PHP's array is powerful, and fast, read and write can be done in O (1), because it is the size of each element is consistent, as long as you know the subscript, you can instantly calculate its corresponding elements in
The following is a summary of the PHP array numeric key names:
The length of the key can only be within the length of the int, and will appear overwritten after the int range.
When you access a value in the range of a key name of int, PHP forces
You may encounter this situation when you write a website, is to write a form that is used to add an article, we fart in the background to receive data, and then into the database. Now there's a question. What do you do when you want to revise the
There are times when you are working on a file that needs to be processed in batches in a directory, this time we need to find all the eligible files in the directory and save them to a result set, and then make it easy to batch, usually by saving
For the day IP is not high or the number of concurrent numbers is not a big application, generally do not consider these! There is no problem with the normal file operation method. However, if the concurrency is high, when we read and write to the
This article will use PHP to round up the numbers to keep n decimal digits, as well as using PHP for the number of rounding method to do a small sum.
(1) PHP retains three decimal places and rounded
$num =0.0215489;
Echo sprintf ("%.3f", $num); 0.
This article mainly shares the knowledge of PHP data type conversion.
PHP data type conversions are cast, and PHP data types that allow conversion are:
(int), (integer): Converting to plastic(float), (double), (real): Converting to floating point
Action Code:
The Public Function index () {
$prod = I ("get.prod_en");
$id = I ("Get.id", 0, "int");
if ($prod = = "") {
$serviceProduct = array ();//Multiple Loops traversal array
The data is stored in two tables, where the
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