Due to the limited speed of csdn, reserve a page. 1. Use PHP to print the previous day in the format of 2006-5? Phpechodate (Y-m-dH: I: s, time ()-60*60*24 echodate (Y: m: dH: I: s, strtotime (-1day ));? 2. The difference between echo (), print (), and print_r () is that the echo is a language structure and has no return value. pr
Due to the limited speed of csdn, reserve a page. 1. Use PHP to print the previous day. The format is 22:21:21? Php // echo date ('Y-m-d H: I: s', time ()-60*60*24 echo date (Y: m: dH: I: s, strtotime (-1day ));? 2. The difference between echo (), print (), and print_r () is that the echo is a language structure and has no return value. pr
Due to the limited speed of csdn, reserve pagination.
1. Use PHP to print the previous day in the format of 22:21:21
// Echo date ('Y-m-d H: I: s', time ()-60*60*24
Echo date ("Y: m: d H: I: s", strtotime ("-1 day "));
?>
2. Differences between echo (), print (), and print_r ()
Echo is a language structure and has no return value. The print function is basically the same as echo. The difference is that print is a function and has a return value. print_r is a recursive print that outputs array objects.
3. templates that can be used to split HTML and PHP
So much, in fact, PHP itself is a template engine, I used smarty, common also PHPLib, FastTemplate, Savant here has a template engine list: http://www.sitepoint.com/forums/showthread.php? T = 123769
4. How to Implement PHP and JSP interaction?
The question is a bit vague. SOAP, XML_RPC, Socket function, and CURL can all achieve this. If PHP and Java are integrated, PHP has built-in this mechanism (If PHP and. NET integration. For example, $ foo = new Java ('java. lang. system ');
5. What tools are used for version control?
CVS and SVN. SVN is known as the next generation of CVS and has powerful functions. However, CVS is a veteran with a high market share. I have been using SVN for a long time. The question is what tools are used. Well, this may require the following answers: CVS Server on Apache as the Server, WinCVS as the client, and Subversion on Apache/DAV as the Server, tortoiseSVN as the client, or Subclipse as the client
6. How to Implement string flip?
Function reverse ($ var)
{
$ Res = "";
For ($ I = 0, $ j = strlen ($ var); $ I <$ j; $ I ++)
{
$ Res = $ var [$ I]. $ res;
}
Return $ res;
}
$ Tmpvar = "wofang ";
$ Res = reverse ($ tmpvar );
Echo $ res;
?>
7. Optimize the MYSQL database.
(1 ). in terms of database design, this is the responsibility of DBA and impact ect. A database with a good design structure should be de-normalized when necessary (I don't know what the Chinese translation is ), some data redundancy is allowed to avoid JOIN operations to improve query efficiency.
(2 ). in terms of system architecture design, the table is hashed, and massive data is hashed into several different tables. fast and slow tables: only the latest data is retained. Slow tables are archived in history. cluster, Master server Read & write, slave server read only, or N servers, each machine is a Master
(3). (1) and (2) better than PHP Programmer's requirements. It doesn't matter. check whether there is any less index.
(4 ). write efficient SQL statements to see if there are any inefficient SQL statements, such as generating full connections to cartesian products, a large number of Group By and order by statements, and no limit. when necessary, encapsulate the database logic in the stored procedure of the DBMS. cache query results and explain each SQL statement
(5). All the results are required. Only necessary data is obtained from the database. For example, you can query the number of comments of an article, select count (*)... where article_id =? You can. Do not select *... where article_id =? Then msql_num_rows.
Send only required SQL statements. For example, if you modify only the title when modifying an article, update... set title =? Where article_id =? Do not set content =? (Large text)
(6). Use different storage engines when necessary. For example, InnoDB can reduce deadlocks. HEAP can increase the query speed by an order of magnitude.
8. Talk about Transaction Processing
Example of A transfer of USD 50 to B's account
9. How to achieve maximum load using apache + mysql + php
See 7
10. Implement the method of intercepting Chinese strings without garbled characters.
Mb_substr ()
11.
$ Empty = '';
$ Null = NULL;
$ Bool = FALSE;
$ NotSet;
$ Array = array ();
// The following are the problems
$ A = "hello ";
$ B = & $;
Unset ($ B );
$ B = "world ";
// The answer is: hello
Echo $;
?>
12.
$ Empty = '';
$ Null = NULL;
$ Bool = FALSE;
$ NotSet;
$ Array = array ();
// The following are the problems
$ A = 1;
$ X = & $;
$ B = $ a ++;
// The following is the answer: 1
Echo $ B;
?>
13
$ Empty = '';
$ Null = NULL;
$ Bool = FALSE;
$ NotSet;
$ Array = array ();
// The following are the problems
$ X = empty ($ array );
// The following is the answer: true
Echo $ x? "True": "false ";
?>
14. Use PHP to write the code that shows the Client IP address and Server IP Address:
$ Ip = gethostbyname ("");
Echo $ ip;
?>
Refer:
1. http://chin.bokee.com/5327971.html