PHP Custom APK installation Package instance

Source: Internet
Author: User

This article describes the PHP custom APK installation package method, share to everyone for your reference. The implementation method is as follows:

<?php//source file $apk    = "gb.apk";//Generate temporary file $file   = Tempnam ("tmp", "zip");//Copy file if (False===file_put_contents ($ File, file_get_contents ($apk))) {    exit (' Copy faild! ');} Open temporary file $zip    = new ziparchive (); $zip->open ($file);//Add files//Because the APK limit can only modify files in this directory, otherwise it will be reported invalid APK package $zip-> AddFromString (' Meta-inf/extends.json ', Json_encode (Array (' author ' = ' Deeka ')));//close Zip$zip->close ();// Download the file header ("Content-type:application/zip"); Header ("Content-length:"). FileSize ($file)); header ("Content-disposition:attachment; Filename=\ "{$apk}\");//output Binary stream ReadFile ($file);//Delete temporary file unlink ($file); >


PHP Custom APK installation Package instance

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.