PHP interview questions

Source: Internet
Author: User

1.1. Add test = 1 for all the following links.

Eg.
<A href = "www.google.com"> Google </a>
<A href = "www.guokr.com? A = 3 "> shell </a>
Result:
<A href = "www.google.com? Test = 3 "> Google </a>
<A href = "www.guokr.com? A = 3 & test = 3 "> shell </a>

1.2. Add test = 1 to the href attribute containing the URL www.google.com.
Eg.
<A href = "www.google.com"> Google </a>
<A href = "www.google.com? A = 3 "> Google </a>
<A href = "www.guokr.com? A = 3 "> shell </a>
Result:
<A href = "www.google.com? Test = 3 "> Google </a>
<A href = "www.google.com? A = 3 & test = 3 "> Google </a>
<A href = "www.guokr.com? A = 3 "> shell </a> the link cannot be matched.

Preg_replace_callback (this function is the easiest to implement), and preg_replace is cumbersome.


2. Briefly describe the factory mode and single-State mode, and write instances respectively!
See http://baike.baidu.com/view/1306799.htm

3. Functions of the following commands in Linux
Grep, Cat, Echo, ls, top, less, WC, PS, iptables, kill, and so on (it seems like this is the case. Repeat Common commands once)


4. Use at least two methods to determine whether the first three characters in a string are ABC.
If ('abc' ==$ STR {0}. $ STR {1}. $ STR {2 })
If (0 === strpos ($ STR, 'abc '))
If (preg_match ('$ ^ ABC $', $ Str ))
If ('abc' = substr ($ STR, 0, 3 ))
5. Briefly describe the functions of the following functions
Sort, asort, ksort, rsort
Use usort () to sort the following arrays in ascending order of the 4th values of the array
$ Arr = array (
Array (1, 2, 4, 5 ),
Array (1, 2, 4 ),
Array (1, 2, 4, 3 ),
Array (1, 2, 4, 2 ),
);
Result After sorting:
$ Arr = array (
Array (1, 2, 4, 2 ),
Array (1, 2, 4, 3 ),
Array (1, 2, 4 ),
Array (1, 2, 4, 5 ),
);

6. Design a high-concurrency, efficient, secure, and stable system.
Tip: from the database, system architecture, and Framework Design Aspects (free to use ).

7. databases are usually used for interviews, with a large number of questions.

About the interview (you will usually ask questions based on your expertise)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.