The explode () function splits the string into arrays.
Syntax
explode (separator,string,limit)
Parameters
Description
Separator
Necessary. Specify where to split the string.
String
Necessary.
In PHP programming, in the traversal of the array often need to calculate the length of the array as the end of the cycle of judgment conditions, while in PHP, the operation of the array is very frequent, so count is a common function, the following
To the official PHP view this function description
Pcntl_alarm (PHP 4 >= 4.3.0, PHP 5)
pcntl_alarm-set a alarm alarm signal for the process
Description ¶int pcntl_alarm (int $seconds)
Creates a timer that sends a SIGALRM signal to the process
Switch statements in PHP are used to perform different actions based on multiple different conditions. If you want to selectively execute one of several blocks of code, use a Switch statement.
Switch syntax
The code is as follows
1. What is a namespace
If you only need to know one of the modern PHP features, it should be a namespace. Namespaces are introduced in PHP5.3.0 to organize PHP code in a virtual hierarchy similar to the directory structure of file systems in the
1. Conceptual understanding
In the case of network programming, we often see synchronous (Sync)/asynchronous (Async), blocking (block)/non-blocking (Unblock) Four ways to invoke: Sync:
synchronization is
when a
Example 1. Mt_rand () example
The code is as follows
Copy Code
Echo Mt_rand (). "N";Echo Mt_rand (). "N";Echo Mt_rand (5, 15);?>The output of the example above is similar to the following:160471601414786132786
echo is very important in PHP, although it seems simple syntax is simple, but the echo function is often used in the program, it is used for the loss, variables, strings, constants, HTML and so on;
As you can see in the past lesson, the PHP
Dynamically build Flash animations using the Ming library
Rich Internet application is a new buzzword in Web 2.0, and one of the key components of Web 2.0 is Adobe Flash. Learn how to integrate Flash animations into your applications and use
Haha, will use only the initial stage, to understand the principle of what, so as to better use, crap not much to say
Pass value: The value of the argument is assigned to the row parameter, the modification of the row parameter does not affect the
1, comments in the template each smarty template file is developed in conjunction with the syntax of the web foreground language (XHTML, CSS, and JavaScript) combined with the Smarty engine. In addition to adding some smarty syntax in the template
More than 100 lines of PHP code to implement SOCKS5 proxy server, this time using Swoole pure asynchronous to write, using the state machine to process data. Currently using it to access open source Chinese wood is stressful, but visit NetEase news
The first approach:Load the Encode module, provided you need to install this moduleExample code:
Copy Code code as follows:
$str =decode ("gb2312", $names [$index]);
@chars =split (//, $STR);
foreach (@chars)
{
$char =encode ("gb2312", $
PHP's error mechanism is also very complex, did a few years of PHP, also did not carefully summed up, now to fill in this lesson.
Special Note: The PHP version of the article uses 5.5.32
Error level of PHP
First you need to know what bugs are in
Before when the time of a project used a simple template engine, in fact, is also a reference to Discuz to do the template engine, very simple, it does is to put some custom tags into PHP code. has said very simple, so the compile time is also
The following code is the php file name extension judgment
check file
file name extension verification
n ways to get file name extensions in PHP
Basically, in the following ways:
The 1th method:
function
Some MiscellaneousThe first is the original intention of writing this article. I have obtained the design blueprint document for Zend Engine 2.0 for some time (now you can download it from the reference URL ), after reading this article, I had the
In PHP, iconv function string is converted from GBK to UTF8 character set1. iconv () IntroductionThe iconv function can convert a known character set file to another known character set file. Example: convert from GB2312 to UTF-8.The iconv function
Extract files from zip files The code is as follows:Copy code /*Php extracts files from zip files*/$ Zip = new ZipArchive; If ($ zip-> open('jquery5-screen scroll corner code .zip ') === TRUE) {// The Chinese file name must use the ANSI-encoded
Usage The code is as follows:Copy code Include 'mobile _ Detect. Php ';$ Detect = new Mobile_Detect ();If ($ detect-> isMobile ()){// Any mobile device. }If ($ detect-> isTablet ()){// Any tablet device. }Check for a specific platform:If ($
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