A picture address decomposition program (for PHP Thief program),
Title, return an array, you can get the image address of the base URL, relative address, name, etc., see the following example:
<?error_reporting (e_all ^ e_notice); $imgurl = ' http://files.jb51.net/file_images/article/ 201408/201408232212306.png '; $imgurl _dir= '/img/2014/07/02/14520384.gif ';//echo getimg ($imgurl, './img '); Var_dump ( Url_set_value ($imgurl)); Var_dump (Url_set_value ($imgurl _dir));/** * Function Name:url_set_value * User:don * Date: 14-8-2 * Time: Morning 12:43 */function Url_set_value ($url) {$a =explode ('/', $url); $url _set=array (); for ($n =0; $n
Operation Result:
Array (4) {["Base_url"]=> string "files.jb51.net" ["Img_dir_path"]=> string "/file_images/article/ 201408 "[" Img_path "]=> string" 201408232212306.png "[" Img_ful_path "]=> string"/file_images/article/" 201408201408232212306.png "}array (3) {[" Img_dir_path "]=> string ()"/img/2014/07/02 "[" Img_path "]=> string (12 "14520384.gif" ["Img_ful_path"]=> string "/img/2014/07/0214520384.gif"}
http://www.bkjia.com/PHPjc/868223.html www.bkjia.com true http://www.bkjia.com/PHPjc/868223.html techarticle a picture address decomposition program (for PHP Thief program), title, return an array, you can get the image address of the base URL, relative address, name, etc., see the following example: Error_rep ...