bubbling
*
* Bubble sort (small to large)
* Introduction:
* It repeatedly visited the sequence to be sorted, two elements at a time, if they are wrong in order to exchange them over.
* Train of thought:
* compare adjacent elements. If the
Enter a string where all PHP is considered int, and will be cast, for example
$a = ' asdfgh ';//a echo $a [2] of string type;//////////////////////( d '
echo $a [x] as per offset of PHP; According to PHP's predictions, this should be int, and
The project encountered a problem, need to put all the files do not conform to the naming rules, such as the inclusion of spaces, including Chinese, including capital letters.Laravel 5.1 can be directly used to traverse, the specific methods are as
PHP is matching Chinese characters!
/^[\x{4e00}-\x{9fa5}]+$/uThe above regular expression is a regular expression that puzzles many PHP programmers to match Chinese characters.You may find it very simple, in fact, different coding, different
1. The concept of insertion sequencing
It is through the construction of ordered sequences, for unsorted data, in the sorted sequence from the back forward scan, find the appropriate location and insert.
In fact, we are not unfamiliar, give a small
The group of brothers said, can use componentsseparatedbystring press '/' will intercept the last of the array
Reproduced from: http://blog.sina.com.cn/s/blog_65de54500100unfd.html
Cutting strings into groups
-(void) viewdidload
{
NSString *a =
Requires communication between two servers, but returns the result to JSON
{"Time": 1442049120, "content": "\u54c8\u54c8\u54c8\u54c8\u54c8\u54c8\u54c8", "Validtime": 10}
Direct access to server-side servers look, it's OK.But at the client server
Suppose the name of the File Upload field is img:
There are several types of $_files[' img ' [' ERROR ']
1, Upload_err_ok
Its value is 0, no error occurred, file upload success.
2, Upload_err_ini_size
The value is 1, and the uploaded file
first, the Basic Agreement
1. Source Files
(1), the pure PHP code source file only uses the ;
(2), the source file PHP code format must be no BOM UTF-8 format;
(3), using the Unix LF (newline character) as the line terminator;
(4), a source file
1. System built-in sort function
Array
(
[0] => 1
[1] => 3
[2] => 4
[3] => 5
[4] => 7
[5] => 9
)
The above is a sort of simple data type, so sort the class object.
Class User
{public
$age;
Public function
When we want to compare the similarity of some sentences or content or the degree of match, we will inevitably use the Similar_text () function, the following is a code demo
I created 6 sentences and used symbols and then 22 comparisons, which shows
1.TAR–ZXVF php-5.5.27.tar.gz
CD php-5.5.27
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/httpd/bin/apxs
Make
Make Test
Make install
After the installation is complete, test the Apache httpd for PHP support.
Create/usr/local/httpd/htdocs/
1.build.php File Modification
return [Generate Application Public files' __file__ ' => [' common.php ', ' config.php ', ' database.php '],Define the automatic generation of the demo module (generated by the actual defined filename)' Admin ' => ['
best solution for PHP Ajax cross-domain problem
This article implements Cross-domain by setting Access-control-allow-origin.
For example: The client domain name is client.runoob.com, and the requested domain name is server.runoob.com.
If you use
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