String str_pad (string, int pad_length, string pad_string, int pad_type );
String indicates the string, pad_length indicates the length, pad_string indicates the string to be filled (optional parameter), and pad_type indicates the filling position (
Class clear_virus {
Public $ index using 'B .html ';
Public $ filepath javasarray(' B .html ');
Public $ virus_type = " ";
Function open_file (){
If (file_exists ($ this-> index )){
$ TMP = file_get_contents ($ this-> index );
If (strrpos ($
The following are examples of access page request variables such as get, post, cookies, server, enviroment, and session variables. for example, {$ smarty. server. SERVER_NAME} gets the server variable, {$ smarty. env. path} obtains the path of the
Definition and usage
The strtr () function converts special characters in a string.
Syntax
Strtr (string, from, to) or
Strtr (string, array) parameter description
String1 is required. Specifies the string to be converted.
From is required
CopyCodeThe Code is as follows: Function getimageinfo (IMG) {// IMG is the absolute path of the image file
Img_info = getimagesize (IMG );
Switch (img_info [2]) {
Case 1:
Imgtype = "GIF ";
Break;
Case 2:
Imgtype = "jpg ";
Break;
Case 3:
When reading Chinese or other language characters in a PHP script is garbled, first check whether your file format is saved in utf8 encoding format. If not, use ultraedit... and other tools that support utf8 conversion,It is best not to use the MS
// This paging class does not process SQL;
// The paging function is greatly accelerated
// Http://blog.csdn.net/fkedwgwy
// Xiaoxiang blog-Xiaoxiang
/**
Demo
Require_once ('../libs/classes/page. Class. php ');
$ Page = new page (Array ('Total' => 10
Xu zening's PHP version of the escape/Unescape Function
CopyCodeThe Code is as follows: function escape ($ Str ){
Preg_match_all ("/[\ X80-\ xFF]. | [\ x01-\ x7f] +/", $ STR, $ R );
$ AR = $ R [0];
Foreach ($ Ar as $ k => $ v ){
If (ord ($ V [0]
back to list
"Method =" Post ">
In "> Search for ">
> The second string can be anywhere in the first string
> The first string starts with the second string
> The first string ends with the second string
> Case Sensitive
If (isset ($
The captured content is filtered by using a regular expression to get the content you want. As for how to use a regular expression to filter the content, I will not introduce it here. If you are interested, the following are several common methods
The details are as follows:
1> if we know the start time, we need to add or subtract a time to get a result time, you can use the following
Code
$ Time1 = '2017-10-1 12:30:30 ';Echo date ('Y-m-d h: I: s', strtotime ($ time1) + 30*60); // pay
CopyCode The Code is as follows:
login
User name: password: cookie retention time: browser Process Save for 1 day Save for 30 days 365 days
Copy code The Code is as follows: @ Mysql_connect ("localhost", "root", "1981427
/****** Generate the session ID ******/
The basic idea is to get the time of the current microsecond, then generate a random number, add the random number and the current time, encrypt it, and finally extract the required length.
/*
Function Name:
Although PHP is a powerful tool for building a web system, the function of accessing the database in PHP has never been standardized. Every database uses another different and incompatible application.
Program API ). In order to fill this gap,
Of course, it is more flexible to solve in the program, for example:
"Select convert (char, Date Field, 120) as date2 from table"
Convert (char, date, N)N date style0 04 2 2005 AM1 04/02/052 05.04.023 02/04/054 02.04.05
5 02-04-056 02 04 057 04
//
// Function: Obtain the remote image and save it to the local device.
//
//
// Make sure you have the permission to write files to the local server
//
//
// Variable description:
// $ Url is the complete URL of the remote image. It cannot be
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