What are the classic interview questions in PHP?
This article is about PHP and how it works. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
For information only, the details are as follows:
1. Print out the previous day's time in PHP format is 2006-5-10 22:21:21(2 minutes)
$a = date("Y-m-d H:i:s", strtotime("-1 day"));print_r($a);
echo(),print(),print_r()
Echo and print are not a function, they are a language construct.
int print(string $arg), only one argument
echo arg1,arg2; can output multiple parameters, return void
echo and print can only print strings, not structures
print_r can print structure
such as
$arr = array("key"=>"value");print_r($arr);
3. Templates that can separate HTML and PHP (1 point)
smarty,phplib
What tools are used for version control? (1 point)
svn,git,cvs
5. How to achieve string inversion? (3 points)
English:
strrev($a)
In Chinese or other languages:
Chinese: GB2312, code is GB2312 coding