This article describes in detail the usage of the switch statement in php and the solution of the switch case when the condition is 0. For more information, see.
Switch statementIf you want to selectively execute one of several code blocks, use the
This article describes in detail how to copy constructors and assign value operators in php. If you need to know more, refer to the example below.
Object assignment and copying: Value assignment: Reload using the "=" Operator
The Code is
This article summarizes the usage of php display_errors and log_errors. For more information, see this article.
Display_errors
Error ECHO, which is commonly used in development mode. However, many applications forget to disable this option in the
In php, you can use the filemtime () function to obtain the file modification time. It can return the last modification time of the file content.
If successful, the time is returned in Unix timestamp format. If it fails, false is returned.
Filemtime
In php, we have many methods to determine whether a variable is null. php provides functions such as empty, isset, var = null, is_null, and so on for variable judgment, next I will share with you how to use these methods.
A simple comparison between
Arithmetic Operators
1. Arithmetic Operators: +,-, *,/, and %.
2. Increment/decrease operators: for example, $ a ++, $ a --, ++ $ a, -- $.
For example:
The Code is as follows:
Copy code
$ A = 10;$ B = 5;$ C = $ a ++; //
In php, You need to combine various functions and references to obtain the complete address of the current page, including the domain name or host address.
Function-based Knowledge
PHP implementation:
The Code is as follows:
Copy code
Referenced files are different from files referenced in asp in php. I will introduce using require and include to reference file instances in php.
Referencing a file is one of the major characteristics of PHP. This method can put common functions
Csv files are read using the fgetcsv function in php. However, in php5.2.8 of linux, the csv file data read by fgetcsv is incomplete. Let's look at the solution to the problem.
In other windows Versions
The Code is as follows:
Copy code
The file_get_contents file is used to read and write files. However, I found that the error message "Note: string can be as large as 2 GB" is returned when I use file_get_contents to read large files. This is no more than 2 GB, is there a solution?
The Curl function is not enabled by default in php. If you need to use Curl, remove the extension = php_curl.dll in php. ini.
I first removed the extension = php_curl.dll in php. ini and restarted the apache environment, but the following function
This article introduces a paginator php paging program code. If you need it, you can refer to it.
The Code is as follows:
Copy code
Class paginator {Function _ construct (){}Static function render ($ page_type, array $ args =
The autoload mechanism makes it possible for PHP programs to automatically include class files when using classes, rather than include all class files at the beginning. This mechanism is also called lazy loading.
The following is an example of using
In php, the header has many functions. Here we will introduce some precautions when using the header for file redirection. I hope this article will bring happiness to all of you.
Header ("Location: login. php ")Header ("Location:") is the php
Php and Other proportional scaling down pictures this article has added to the favorites four functions about using php to scale down the Image Code. we can define the width or height of the image to narrow down or enlarge the image width, let's
Use ImageCreate () to create a variable that represents a blank image. This function requires a parameter of the image size in pixels. The format is ImageCreate (x_size, y_size ). To create an image of 250x250 in size, use the following
This article briefly describes how php uses its own functions to sort the element values of an array in descending order. For more information, see.
The rsort () function sorts array elements in reverse order by key value. Similar to arsort.
Note:
The article focuses on the usage of foreach loop and list loop statements. Let's take a look at the implementation below. If you need more, you can refer to it.
I recently bought php and mysql web development and saw the array loop statements. It is
I have nothing to do today to tell you that I learned php many years ago to learn how to use get global variables. For more information, see.
1. $ _ GET is used to obtain data in the form of get in the table method.2. $ _ GET url. php? I = 12
This is a simple entry to data query in php and mysql. We have introduced several of the most important functions in detail. If you need them, you can take a look.
The Code is as follows:
Copy code
// Link to the database$
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