PHP face question set PHP face question set

Source: Internet
Author: User
Tags svn

Khan ~ ~ done a network of PHP topics, unknowingly do now ... Post the answers.
If you have any questions, please feel free to add and correct

1, with PHP printed out the day before the format is 2006-5-10 22:21:21 (2 points) $a = date ("y-m-d h:i:s", Strtotime ("1 day")); Print_r ($a);

2, Echo (), print (), Print_r () difference (3) Echo and print are not a function, is a language structure int print (string $arg), only one parameter echo arg1, ARG1,ARG2; Can output multiple parameters, return void Echo and print can only print out a string, can not print out the structure Print_r can print out the structure such as $arr = Array ("Key" => "value"); Print_r ($arr);

3, can make HTML and PHP separated from the use of the template (1 points) smarty,phplib

4. What tools are used for version control? (1 points) Svn,git,cvs

5, how to implement string flip? (3 points) English: Strrev ($a) Chinese or other text: Chinese: GB2312, code is using GB2312 encoding <?php function Reverse ($str) {$ret = ""; Len=mbstrwidth (Len=mbstrwidth (str, "GB2312"); for (i=0; i=0;i< len; len;i++) {arr[]=mbsubstr (str, $i , 1, "GB2312"); Return implode ("", Array_reverse ($arr)); Print_r (Reverse ("Hello"));

---------------------------------------------------------------6, the method of optimizing MySQL database. (4 points, more written) statement: 1 use index, increase query Efficiency 2 optimize query statements, improve the index hit rate database related aspects: 1 constructs the storehouse to divide the table, enhances the database storage and the expansion ability 2 uses the different storage engine according to the need

7, PHP meaning (send 1 points) Super text preprocessing language hypertext preprocessor

8, MySQL to obtain the current time function is?, the function of the format date is (2) current_timestamp () date_format () Select Date_format ("2011-11-21 10:10:10", "%y-%m- %d ");

9, the implementation of the text string interception without garbled method. (3 points) Mb_substr ($STR, 1, 1, "GB2312");

---------------------------------------------------------------10, have you ever used version control software? What is the name of the version control software you are using? (1 points) svn git

11, have you used the template engine? What if you have the name of the template engine you're using? (1 points) Smarty

12, please briefly describe your most proud development (4) XXX

13, for the large flow of the Web site, what method do you use to solve the problem of access volume? (4 points) 1 effective use of caching, increase cache hit rate 2 use load Balancing 3 use CDN for static files to store and accelerate 4 ideas reduce the use of the database 5 see where the statistical bottlenecks are

-----------------------------------------------------------------14, write in PHP to display the client IP and server IP code 1 points) $_server["Remote_ ADDR "] $_server[" SERVER_ADDR "]

15. What is the difference between statement include and require? To avoid including the same file multiple times, use (?) Statements instead of them? (2 points) in the case of failure: include generates a warning, and require produces a direct error interrupt require load include at runtime to load require_once include_once

16, how to modify the lifetime of the session (1 points). Session_set_cookie_params

17, there is a web address, such as the PHP Lab homepage: http://www.phpv.net/index.html, how to get its content? (sub) File_get_contents Curl

18, in HTTP 1.0, the meaning of status code 401 is (?); If you return the prompt "file not found", the header function is available, and the statement is (?);( 2 points) Not authorized header ("http/1.0 404 Not Found"); Fast CGI: Header ("status:404 not Found");

19, in PHP, Heredoc is a special string, it's the end of the flag must be? (1 points) in pairs appear $a = <<eod good test EOD;

20, talk about the pros and cons of asp,php,jsp (1 points) ASP is dependent on IIS, is the language developed by Microsoft PHP and JSP can rely on Apache or Nginx and other servers

21, talk about the understanding of MVC (1 points) Model: Data structure Layer view: Show Control: Receive and judge processing input

-------------------------------------------------------------------22, write off the top 10 names of SQL, using the following table: Members (ID, Username,posts,pass,email) (2 points) select top Id,username from members order by posts DESC

23. Please explain the difference between the value in PHP and the reference in the pass. When does the value pass the reference? (2 points) & indicates that parameter passing in a reference function will change the parameters generally consider using references when there are multiple output parameters

24. What is the function of error_reporting in PHP? (1 points) Set error display level

25. Please write a function to verify that the email format is correct (2 points) $str = "jianfeng@126.com"; Regex= "

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.