PHP Simple implementation of the method of bulk upload pictures, _php tutorial

Source: Internet
Author: User
Tags getting started with php

PHP Simple implementation of the method of bulk upload pictures,


This paper introduces a simple way to implement bulk upload images in PHP. Share to everyone for your reference, as follows:

<?phpfunction Upload_multi ($path, $photo, $i) {$uploaddir = './'. $path;//file directory if (!file_exists ($uploaddir))// If the directory does not exist, create a new $uploaddir=mkdir ($uploaddir), $piece = Explode ('. ', $photo [' name '] [$i]); $uploadfile = $uploaddir. '/'. MD5 ($piece [0]). $piece [1]; $result = Move_uploaded_file ($photo [' tmp_name '] [$i], $uploadfile), if (! $result) {exit (' upload failed ');} Return basename ($uploadfile);} if ($_post[' Tijiao ')) {extract ($_post), $i =0;foreach ($_files["Pictures" ["Error"] as $key = $error) {if ($error = = UPLOAD_ERR_OK) {Upload_multi ($email, $_files["Pictures"], $i);} $i + +;}}? >

More about PHP related content readers can view the topic: "PHP File Operation Summary", "PHP operation and operator Usage Summary", "PHP Network Programming Skills Summary", "PHP Basic Grammar Introductory Tutorial", "PHP operation Office Document tips summary (including word, excel,access,ppt), "PHP Date and Time usage summary", "PHP primer for Object-oriented programming", "PHP String Usage Summary", "Getting Started with Php+mysql database operations" and "PHP Common Database Operations Skills Summary"

I hope this article is helpful to you in PHP programming.

http://www.bkjia.com/PHPjc/1125898.html www.bkjia.com true http://www.bkjia.com/PHPjc/1125898.html techarticle PHP Simple implementation of the method of bulk upload pictures, the example of this article on PHP simple implementation of the method of bulk upload pictures. Share to everyone for your reference, specifically as follows: Phpfunction upload_ ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.