1, using PHP to print out the day before, the format is 2006-5-10 22:21:21.
1 Echo Date ("Y-m-d h:i:s",strtotime('-1 day '));
Attach other formats for the Strtotime function:
1 Echo Strtotime("Now" );2 Echo Strtotime("Ten September 2000" );3 Echo Strtotime("+1 Day" );4 Echo Strtotime("+1 Week" );5 Echo Strtotime("+1 Week 2 days 4 hours 2 seconds" );6 Echo Strtotime("Next Thursday" );7 Echo Strtotime("Last Monday");
2. The difference between echo (), print (), Print_r ()
Echo () is a PHP statement, print () and print_r () are functions, the statement has no return value, and the function has a return value. Print () prints only the value of a simple type variable (such as int,string), and Print_r () can print out the value of a complex type variable (such as an array, an object). Echo () outputs one or more strings.
3. What is PHP?
The English full name of PHP, hypertext preprocessor; Chinese names are ' hypertext preprocessor ', which is an open source scripting language, which absorbs the features of C, Java, and Perl, and is mainly applicable to the field of web development.
PHP Simple test questions