Some of the less common features of PHP 1. variable function name. you can concatenate the function name functionaa ($ str) {echo $ str;} $ function = "aa"; $ function ('Hello '); // or php features that are not commonly used
1. variable function name, which can be concatenated with a string
function aa($str) { echo $str;}$function = "aa";$function('Hello');// ORcall_user_func($function, $param);
2. list all functions and determine whether a function exists.
get_defined_functions()function_exist()
3. accept PUT requests, essential for PHP REST
parse_str(file_get_contents('php://input'), $put_vars);
4. parse time from string
echo date('Y-m-d', strtotime('-1 month ago'));
5. View and call backtrace in DEBUG
$backtrace = debug_backtrace();var_export($backtrace[0])die();
6. interactive command line, command line execution PHP
Php-a and php-r 'echo "hello ";'
For more information, see php-h.
7. memory usage detection
memory_get_peak_usage()memory_get_usage()