In php, there are many ways to convert a time date into a timestamp (converted to milliseconds). The simplest way is to use time () the result can be obtained in milliseconds, for example,. Other methods are required.
The mktime () function is very
Php bit operations are not often used in php, but they are very useful. Next we will introduce the usage of php bit operations.
$ A & $ B and (bitwise and)$ A | $ B or (by bit or)$ A ^ $ B Xor (bitwise Xor)~ $ A Not (Not by bit)$ A $ A >>$ B Shift
There are several methods to jump out of the loop in php, one is to use goto, and the other is to use the new php goto command. I will introduce it below.
Break is used in various loops and switch statements mentioned above. Its role is to jump out
The simplest and most practical Regular Expression for php mobile phone numbers. For more information, see.
Mobile: 134, 135, 136, 137, 138, 139, 150, 151, 157 (TD), 158, 159, 187, 188
China Unicom: 130, 131, 132, 152, 155, 156, 185, 186
China
Here we have pm_user, which is a data table without creating tables. You can create a table by yourself. Next we will only introduce the program code for logging on with php and then logging out. If you need it, please refer to it.
Login.htm
In php, there are many ways to traverse arrays, such as foreach, each, list, and for. However, in these ways, foreach provides the best array traversal performance, so I also use it frequently, next I will introduce the handler foreach to traverse
String processing has a large number of character or string processing functions in php. Let's summarize the learning notes on PHP string processing today, this is not only a learning note, but also has great advantages in developing
Today, when we use the empty () function to determine whether a variable is null, the following message is displayed: empty () only checks variables as anything else will result in a parse error. in other words, the following will not work: empty
Today, when I was working on a php verification code program, I found that the generated image was not displayed. I thought it was because the php gd library was not opened. I checked it with phpinfo, the following small series will introduce the
In php, if we want to get a millisecond, we have to use microtime () for conversion. Next I will give you some examples, hoping to help you.
Not afraid of mental retardation... Everything
The Code is as follows:
Copy code
I used getimagesize to get the size of the original image, and then x0.5 is to set the image/5.
Array getimagesize (string $ filename [, array & $ imageinfo])The getimagesize () function will determine any gif, jpg, png, swf, swc, pstutorial d, tiff,
If the thumbnail is an image, we can use the php gD library directly. This article will introduce the Imagick method to generate png thumbnails for pdf files. Here we will use a plug-in, the following is an example.
Php_imagick
A PHP extension that
This article will introduce you to an article about the gray and transparent effects of php on images. I hope this method will be helpful to you.
Principle:
1. Calculate the size of the original image2. Create a translucent image of the same size3.
This article uses some of your own experience to tell your hacker friends how to use your database SQL vulnerability to download your database. If you need it, refer to this article.
Create a table in the database:
The Code is as follows:
There are many ways to use php to export a mysql database as an excel table. The simplest way is to directly use the php fputcsv function. You can also directly input the csv format, to generate a standard excel format, we need a third-party plug-in.
Php and mysql passwords are mostly irrelevant to php. In this case, we only need to process the page and mysql encoding to solve the Garbled text problem. The Garbled text is only garbled Chinese characters.
PHP + MYSQL has encountered character
For php5.3 or later, you can use php to manage crontab tasks. Next, let me try it out. If you need to learn more, please refer to it.
1. Use php-crontab-manager to manage scheduled tasksPHP> = 5.3
Example
The Code is as follows:
Copy
This article will introduce you to the Php CURL simulated login to the Forum and collect data instances. If you are interested in using the curl simulated login function, go to the reference page.
To simulate browser access to a website, you should
The page cache saves the page to a file. The file is called directly next time you read it without querying the database. Here we will introduce how to use ob_start.
Example
The Code is as follows:
Copy code
Ob_start (); //
This article describes two php process judgment statements: switch statement and if else and if () statement. Let's take a look at the example in detail.
The Code is as follows:
Copy code
Switch (variable ){Case
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