1. convert a string into an arrayStr_split () is used to convert a string into an array.Syntax:
$ Str = "www.jbxue.com ";Print_r (str_split ($ str ));?>
2. string segmentation FunctionsThe explode () function separates strings into
Add [] to the name of the input Tag FILE type of the html file to create an array in the html file. For example, the name is pictures, the multi-file reference name is pictures [], and the instance is as follows:
The Code is as follows:
I. node. JS is event-driven and asynchronous programming.
The term event-driven is no stranger. In network programming in some traditional languages, we will use callback functions. For example, when the socket resource reaches a certain state, the
5. Miscellaneous5.1 generate imagesPHP can process images. If you have installed the GD library, you can even use PHP to generate images.Header ("Content-type: image/gif ");$ String = implode ($ argv ,"");$ Im = imagecreatefromgif
In PHP, execute the system external command PHP as a script language on the server, such as writing simple, or complex dynamic web pages, it is fully competent. But this is not always the case. Sometimes, to implement a function, you must use an
Source: PHPBuilder.comOriginal Author: Luis ArgerichTranslation: erquanErquan Note: I have not had time to experience PHP5 yet. I just translated an article about foreigners.The following are all translated by erquan. 1st times of doing these things
The following method is a general summary of the massive data processing methods. Of course, these methods may not completely cover all the problems, however, such methods can basically deal with the vast majority of problems encountered. The
Online Demo address: http://tools.jb51.net/tools/cs.phpCopy codeThe Code is as follows:Function zhuanhuan (){$ Urlodd = explode ('/', $ _ GET ["url"], 2); // divide the link into two sections. // The first section is the first section, followed by
With the return of Steve Jobs and the release of iPad2, it seems that mobile development is becoming increasingly popular. This section describes how to detect the Android system, the biggest competitor to iOS.JavaScript Judgment MethodSearching for
Listing 1. Simple throttlingMany games and game systems require dice. Let's start with the simple part: throw a six-sided dice. In fact, rolling a six-sided dice means selecting a random number from 1 to 6. In PHP, this is very simple: echo rand
The + operator appends elements of remaining keys from the right handed array to the left handed, whereas duplicated keys are NOT overwritten.I only know this when I read php manual again today.Copy codeThe Code is as follows:$ A = array ("a" =>
Integer can be in decimal, octal, or hexadecimal format.In octal notation, the number must start with 0 (0;In hexadecimal notation, the number must begin with 0x (Zero x) or 0X (Zero capital X;Integer Overflow: When an integer overflows, it is
File_exists () check whether the file or directory existsDescriptionBool file_exists (string filename)If a file or directory specified by filename exists, TRUE is returned; otherwise, FALSE is returned.The dirname () function returns the directory
1. When file_get_contents can be used to replace file, fopen, feof, fgets, and other methods, try to use file_get_contents, because its efficiency is much higher! Note the PHP version of file_get_contents when opening a URL file;2. Perform as few
As a result, I think about how PHP objects are serialized and stored with the most cost-effective performance? Then I thought of the JSON encoding and decoding functions recommended by my colleagues.According to him, json_encode and json_decode are
Php read single-choice button radio Value Copy codeThe Code is as follows: radio value of the php read single-choice button Single choice 1 Single choice 2 If ($ _ POST){Echo 'select a single select', $ _ POST ['radiogroup1'];// Since the attributes
* Ini_get (): gets the option value of the configuration file.
This function is often used by many people to obtain the value of an option in the configuration file. If it is true, 1 is returned. If it is false, 0 is returned, and the string is
In_array(PHP 4, PHP 5)In_array-check whether a value exists in the arrayDescriptionCopy codeThe Code is as follows: bool in_array (mixed $ needle, array $ haystack [, bool $ strict])Search for needle in haystack. If yes, TRUE is returned. Otherwise,
This is one collected a long time ago. I don't know who wrote it, but there is no problem after testing ~JavaScript codeCopy codeThe Code is as follows:Function phpUnescape ($ escstr){Preg_match_all ("/% u [0-9A-Za-z] {4} | %. {2} | [0-9a-zA-Z. +-_]
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