What are the little-known php skills? What are the little-known php skills?
The problem has been disabled. cause: the problem cannot obtain the exact result.
Reply content:
What are the little-known php skills?
According to my recent interview, 90% people do not know that the latest stable PHP version is 5.6. (The job is for advanced PHP development)
Okay, let's say:
ini_getOnly PHP built-in and extended configuration can be obtained. Custom configuration added by yourself cannot be obtained through ini_get. Whileget_cfg_varThe function can read the custom configuration key values in php. ini.
Article 1: upgrade PHP 5.4-5.6
Article 2: anyway
PS: PHP5.2/3 is still used.
Shake your head.
Php6 is actually useless.
php -aYou can enter the interactive environment
PHP provides two predefined variables for receiving command line parameters in PHP scripts:
Http://php.net/manual/zh/reserved.variables.php
$ Number of parameters passed to the script by argc
$ Argv [] parameter array passed to the script
Getopt can be used to obtain the command line parameter options and return an Associated array of parameter names and values.
Http://php.net/manual/zh/function.getopt.php
Separate characters (not allowed)
Followed by a colon (this option requires a value)
Followed by two colons (optional)
#! /Png/php/5.4.39cnt/bin/php
Chmod + x cli. php./cli. php-a1024-b2048 or php cli. php-a1024-b2048
Output:
Array( [a] => 1024 [b] => 2048)
Comment out$argv = getopt("a:b:")Output:
Array( [0] => ./cli.php [1] => -a1024 [2] => -b2048)
PHP can also be used as an automated system management script like Perl:
$ Argv [] parameter array stored in the PHP script:
Http://php.net/manual/zh/reserved.variables.php
PHP provides many file system operating functions, such:
Http://php.net/manual/zh/ref.filesystem.php
file_existsfile_get_contentsfile_put_contentsis_readableis_writableis_executableis_dirmkdirrmdirunlinkchmod
PHP can also call system commands as easily as Shell by using the anti-apostrophes 'or shell_exec, you can also easily use popen/proc_open to open a non-blocking pipeline to execute commands and obtain the returned data. the key is that PHP also has a built-in super invincible and easy-to-use associated array (hash table) and a series of array operation functions and string processing functions. this is cool, not to mention.
Common operations are Excal and compressed packages in PHP.
Haha, in fact, all the manuals are written.