Sometimes we want to output variables in characters. We may use dump_var, but if we want to output them automatically, We need to calculate the final function.
The Code is as follows:
Copy code
Function show_var ($ var ){If
PHP provides over 700 built-in functions. PHP functions are divided into user-defined functions and system built-in functions. Built-in functions can be used directly. User-defined functions must be defined using the keyword function.
Custom
Below I have summarized some character Replacement Methods in php development, including direct replacement without regular expressions or replacement with regular expressions, and replacement using php built-in functions.
For example, there is a
This article introduces how to obtain the time of PHP date () and time () inconsistent with the local time. If you need it, refer to the solution.
Add
Use in the page header
The Code is as follows:
Copy code
When accessing the member variables or methods in the PHP class, if the referenced variables or methods are declared as const (defining constants) or static (declaring static), the operator must be used:: If the referenced variable or method is not
Logical operators in php are not equal to, or, and are not (priority is :! >&>||> And> xor> or). Next I will introduce you to the use of logical operators in php.
Note:
Priority :! >&>||> And> xor> orNote: Even though! Higher than =, PHP still
Variables are used to store values, such as numbers, strings, or function results, so that we can use them multiple times in the script to store values, such as numbers, text strings, or arrays.
Once a variable is set, we can reuse it in the script.
To count the first and last days of a month in php, we can use the strtotime function for conversion. The following describes two methods for your reference.
The strtotime function is mainly used. It has powerful functions and supports relative
Some of my friends may encounter some problems: When uploading files, if the original name is good in English, there will be no problems. If it is Chinese, garbled characters may occur, today, I will summarize the causes and solutions for garbled
The Code is as follows:
Copy code
/*** Obtain the image address in CSS and save it to the local device.*/Class getInCssImage{/*** Save the image* @ Param $ css url* @ Param $ dir: directory for saving images* @ Return void*/Static
Next, I will introduce you to a php file to get the address of the video swf player on the Youku Tudou page. If you do not have enough temporary information, please share it with me.
The Code is as follows:
Copy code
The
The simplest way to intercept a string in php is to use the substr () function, but the substr function can only intercept English. If it is a Chinese character, it will not be garbled, some friends say that they can use mb_substr () to intercept
This code can add a shark to the uploaded image and scale the image proportionally. For more information, see.
This code can add a shark to the uploaded image and scale the image proportionally. For more information, see.
$ Uptypes = array ('image/
The implementation code of a small Graph Generation function. If you need it, you can refer to it. Each of them has detailed parameter descriptions.
The Code is as follows:
Copy code
Uploads. php fileClass image_upload
A good simple database connection program. If you need a php mysql database connection class, please refer to this article.
The Code is as follows:
Copy code
Require_once ("mssql. class. php ");// 1. Create a class and
All the generated excel files use the phpExcel class. Next I will introduce the solution to the problem that the generated excel column name contains more than 26 columns and is greater than Z.
This is a method in the phpExcel class. I found it
The Static keyword is used to describe the member attributes and member methods in the class. The final keyword can only be used to define the class and method. The final keyword cannot be used to define the member attributes, because final is the
In php, we use unlink to delete files and directories. To delete directories that are not empty, we use readdir and opendir to traverse the directories.
The Code is as follows:
Copy code
// Delete the folder and all its
In php, array_multisort () can sort multiple arrays at a time, or sort multi-dimensional arrays based on one or more dimensions. If the result is successful, TRUE is returned, and FALSE is returned if the result fails.
Bool array_multisort (array ar1
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