e-mail delivery and collection is one of the most important ways of online communication, we certainly hope that their PHP program can also be implemented in some commercial web site registration procedures used in the way, that is, through the mail
PHP Data typePHP supports eight original types (type).
4 Kinds of scalar types:String (String), Integer (integer), float (floating-point type, also double), Boolean (Boolean)Two types of composite:Array (array), Object (objects)Two special
Object-Oriented Development summary
1. Description and configuration of the object. (Can be understood as a description of the output text of an object)2. A processing of object methods. (It can be understood that customizing more humane error
Which of the following three types of writing is true?
In the PHP program, what is the naming rule for variables, which of the following three ways is correct?
The 1th kind:$myname = ' AA ';?>
The 2nd kind:$myName = ' AA ';?>
The 3rd
There are times when you do a lot of system work through PHP, and it's not as quick as using bash directly. PHP-FPM default is the Apache user, directly into the root account, is not able to start. In this case, the Apache user cannot execute
Data caching
Here is the data cache refers to the database query cache, each visit to the page, will first detect the corresponding cache data exists, if not, connect the database, get the data, and the query results serialized after saving to the
void list (mixed varname, mixed ...)Note: List () can only be used for arrays of numeric indices and assumes that the numeric index starts at 0
Example
code is as follows
copy code
. PHP $info = array (' coffee
The code is as follows
Copy Code
function Funcmtel ($STR)//mobile number Regular expression test{Return (Preg_match ("/(?: 13d{1}|15[03689]) d{8}$/", $str))? True:false;}
Test
18678785887
Return to
False
Cause analysis,
The code is as follows
Copy Code
$uAgent = $_server[' http_user_agent '];$osPat = "mozilla|m3gate|winwap|openwave| Windows nt| Windows 3.1|95| blackcomb|98| me| X window|ubuntu| longhorn| Aix| Linux| amigaos| beos| Hp-ux| openbsd|
Look at an example
The code is as follows
Copy Code
Class Cart { var $items; //Shopping cart Items //Put $num $a Rtnr into the car function Add_item ($ARTNR, $num) { $this->items[$artnr] + =
?PHP Tutorial easiest to get array last no element value
The code is as follows
Copy Code
Method One$url = ' www.111cn.net.cc ';$TMPURL = Explode ('. ', $url);
Output Temurl lookPrint_r ($TMPURL);/*Results:
In the JSON does not support Chinese, use it to send Chinese data will appear data loss or garbled, must be sent before the transmission of the string to encode, because the transmission in the past need to use JS data analysis, considering the JS
In the past few days, the web often encountered Nginx 502 problems. At first, as many people thought it was Nginx, I checked from the internet and found that it was originally a php-fpm problem. The web uses the nginx + php architecture. It is not
If the uploaded directory is embedded with a PHP file, the file can be executed remotely. For the sake of security, PHP scripts cannot be run on the upload directory.In Apache, we can use the following method to disable the running of PHP
Then, extract the message to be exported from it. The code is as follows. The following code is offline and will not be disclosed online, it is a very simple php Tutorial: The code is as follows:Copy code /* Convert hexadecimal encoding to
Php curl extension can help us quickly implement HTTP requests.When using the doubanoauth login interface, we need to send such an http request: The code is as follows:Copy code GET/v2/user /~ I HTTP/1.1Host: https://api.douban.comAuthorization:
The following example maps a tag in an XML document to an HTML tag. Elements that do not exist in the ing array are ignored. Of course, this example will only be valid for a specific XML document.$ File = "data. xml ";$ Map_array = array ("BOLD" => "
Recently, I used PHP as a community. When I wrote the code to calculate the maximum number of online users, I successfully debugged the code to run PHP directly on the server as a shell script.When working in the community, it is often necessary to
Scenario/problem description:The Ajax submission page is encoded as gb2312, and the database is encoded as utf8. Data is inserted without modifying the page and database encoding.Custom functions: The code is as follows:Copy code Function
One of the common errors on the web is invalid links. Once an invalid link appears from another site, you will reschedule your site. People will save their favorite sites as bookmarks. If they visit the site again three months later and only find '20
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