categorization
arrange in order
php Extract image addresses from HTML articles class
php Extract image addresses from HTML articles class
PHP Simple Generation of Random Numbers, Strings
1. Generate random string /** * Generate random string * * @param int $length Output length * @param string $chars Optional , default is 0123456789 * @return string string */ function random( $length, $chars ...
PHP DateTime common methods
Instantiation of an object preceded by \ means that the native class is used in the namespace, if the namespace is not used, you can remove the preceding \ 1. Output the current time $datetime = new \DateTime; print_r($datetime->format('Y-m-d H:i...
PHP common methods to manipulate directories or files
1, convert \ to / /** * Convert \ to / * * * @param string $path path * @return string path */ function dir_path($path) { $path = str_replace('\\', '/', $path); if(substr($path, -1) ! = '/'...
PHP common string processing methods
1, realize the search engine to search results hit the keyword marked red <?php /** * Split the string into an array * @param $search search keyword * @return array */ function splitString(string $search):array { // positive ...











