CopyCodeThe Code is as follows: strpos (string, find, start)
Instance:Copy codeThe Code is as follows:
Output 6Copy codeThe Code is as follows: substr (string, start, length)
The START Parameter
Positive number-start at the specified position
(1) The static method is four times faster than the normal method.(2) echo output is faster than print(3) Use the connection character instead.(4) take the maximum value before the loop, instead of taking the value in the loop.Correct Method$ Max =
I recently completed a transitional project and used PHP. I used to see how PHP looks awkward and poor maintainability,
Code Chaos is my impression. This time, I decided to take some time to see if there is any need to understand it,
Three
I remember reading this thing some time ago, but it seems like C or C. You don't need to exchange the values of two variables. In addition to the "regular" methods discussed earlier, PHP also has one method:
List ($ var1, $ var2) = array ($ var2,
(1) urlencode function.Encode the input string.Syntax:String urlencode (string Str );The returned string contains -. ", all non-alphanumeric characters are replaced with a semicolon (%) followed by two hexadecimal numbers, and spaces are encoded as
Address: http://blog.sina.com.cn/s/blog_4dd475390100ryp9.html
Create a database tiask and execute the following SQL
/* Navicat Mysql Data TransferSource server: localhostSource server version: 50067Source HOST: localhost: 3306Source database:
Now that I have a new job, I want to leave windows and develop PHP under FreeBSD. Interestingly, I made another mistake."Treat hobbies as work".In the beginning, let's talk about a good tool that I always
Cache. php
Code PHP Code cachefilevar and the name $ this-> cachefile // different parameters on the dynamic page correspond to different cache files, however, all the cache files on each dynamic page have the same file name, but the extension is
The $ _ FILES array contains the following content:$ _ FILES ['myfile'] ['name'] original name of the client file.$ _ FILES ['myfile'] ['type'] indicates the MIME type of the file, which must be supported by the browser, for example, "image/gif ".$ _
The core concept in the previous article is give action do something!
In this article, I will use code to explain what this concept means. First, let's look at my post. class. php. file as our data layer processing class.
This model class inherits
(1) Using functions provided by php, array_unique and array_diff_assoc
Copy codeThe Code is as follows: Function FetchRepeatMemberInArray ($ array ){
// Obtain the array for removing duplicate data
$ Unique_arr = array_unique ($ array );
// Obtain
Copy codeThe Code is as follows: // -- Call method/demo. php? Url = http://v.youku.com/v_show/id_XMzkyODA2NTEy.html
Echo getYoukuFlv ($ _ GET ['url']);
Function getYoukuFlv ($ url ){Preg_match ("# id _(.*?) \. Html # ", $ url, $ out );$ Id = $ out [
PHP 4 introduces the foreach structure, which is similar to Perl and other languages. This is just a simple way to traverse arrays. Foreach can only be used for arrays. An error occurs when you try to use it for another data type or an uninitialized
A problem occurs during php learning,Use the GD library to plot and set the font PATH variable:Putenv ('gdfontpath = c: \ windows \ fonts ');$ Fontname = 'arial ';$ Bbox = imagettfbbox ($ font_size, 0, $ fontname, $ button_text );
Tip:Cannot find
Array_merge discards the key of the original number, retains the key in the string form, and then forms a new array. no matter whether the key name is the same or not, it is not merged, unless the key name and value are the same and must also be a
1. Differences between echo and printThe echo and print functions in PHP are basically the same (output), but there are still slight differences between the two. No return value after echo output, but print has a return value. If the execution fails,
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