CopyCodeThe Code is as follows: $ Foo = 'bob'; // assign 'bob' to $ Foo.
$ Bar = & $ Foo; // reference $ Foo through $ bar
Echo $ Foo. ' ';
$ Bar = "My name is $ bar"; // modify the $ bar variable.
Echo $ bar. ' ';
Echo $ Foo. ''; // the value
Call_user_func_array
(PHP 4> = 4.0.4, PHP 5)
Call_user_func_array -- call a User Function Given with an array of parametersDescriptionMixed call_user_func_array (callback function, array param_arr)
Call a user defined function given by
If the values are not repeated, you can use array_flip () to exchange keys and values, then krsort (), and then array_flip () to compare the values. Array_slice () is available to intercept arrays ().
If there are duplicate values, some sorting
In fact, we can use the array_filter function to easily remove multi-dimensional null values without changing the subscript of the array. The following is an example:
$ Array = array (
0 => 'your go ',
1 => false,
2 => 1,
3 => null,
4 => '',
5
Copy codeThe Code is as follows: // This method is purely a back-function and is not explained;
Function countStr ($ str ){
$ Str_array = str_split ($ str );
$ Str_array = array_count_values ($ str_array );
Arsort ($ str_array );
Return $ str_array;
The php code is as follows:
Copy codeThe Code is as follows: Header ("Content-type: text/html; charset = UTF-8 ");
If (! Empty ($ _ POST ['submit ']) {
$ Url = $ _ POST ['url'];
// Operations to obtain images with relative paths
$ Url_fields = parse_
For example, the following program:
Copy codeThe Code is as follows:
$ Arr = array ('apple', 'Banana ', 'cat', 'Dog ');
Unset ($ arr [2]);Print_r ($ arr );
?>
Program running result:Copy codeThe Code is as follows: Array ([0] => apple [1] => banana
I. apache server Security Settings
1. Run with a Nobody user
Generally, Apache is installed and run by the Root user. If the Apache Server process has the Root user privilege, it will pose a great threat to system security. Ensure that the Apache
Let's talk about the purpose of this mechanism. Till now, the battlefield has known that this mechanism has two purposes:
First, we should be able to understand the problem of sharing sessions among multiple servers. When the number of users on a
I. Bubble SortingNote: Find the maximum number, arrange it to the last side, and continue to find it.
Example:Copy codeThe Code is as follows: $ arr = array (,-, 2 );For ($ I = 0; $ I For ($ j = 0; $ j If ($ arr [$ j]> $ arr [$ j + 1]) {$ Temp = $
Click the Mind Map to view the big picture.IntroductionI will write down my favorite and interesting topics and share them with you. The last time I wrote an article "talking with the boss in php". I still have many questions. This book has helped
Today we have handled a very small problem.
This is the requirement. From Monday to Sunday, only data from last Monday to last Sunday can be seen.
Here we can query the range directly from the Database Based on the date field.
However, PHP needs to
When we use CURL to post data, we need to set post data.
Curl_setopt ($ c, CURLOPT_POSTFIELDS, $ post_data );
Assume that $ data isCopy codeThe Code is as follows: $ data = array ('Name' => 'scofield ','Time' => '2014-2-3')
Next, you need to
1. No matter what program, function name () {}, (){},.... There are too many things to be done.
2. $ str {4} after the variable of the string is treated as an array like the variable.
Iii. {$ val} at this time, braces are used to tell PHP that the
Hackers can gain access to the website database through SQL injection attacks, and then they can obtain all the data in the website database, malicious hackers can use SQL injection to tamper with the data in the database and even destroy the data
Libcurl also supports HTTPS authentication, http post, http put, and FTP upload (this can also be completed through the FTP extension of PHP) HTTP form-based upload, proxy, cookies, user name + password authentication.
Php curl is really quite easy
I have written a registry class before, but that one cannot register multiple classes. The classes are stored using arrays below.
Copy codeThe Code is as follows: // Basic class
Class webSite {// a very simple basic class
Private $ siteName;
Private
Syntax:
Substr (string to be intercepted, start position, and truncation length)
The start position starts from 0. If you want to extract from the first character, the start position parameter is 0.The last parameter is optional. If only the
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