** کینگ کد : بزرگترین مرجع دانلود سورس کد های برنامه نویسی اندروید، ویندوز و جدید ترین اسکریپت های روز دنیا **
-----------------------------------------------
** سورس فروشگاه اینترنتی مارکیت فارسی برای اندروید - سورس فروشگاه اینترنتی موکتز فارسی برای اندروید **
-----------------------------------------------
** اسکریپت چیست؟ و چگونه از آن استفاده کنیم؟ (آموزش کامل نصب اسکریپت) **
-----------------------------------------------
** (160 جلسه) آموزش کامل و 0 تا 100 برنامه نویسی PHP **
-----------------------------------------------
** دانلود فیلم آموزشی فتوشاپ فارسی **
-----------------------------------------------
» بروزترین سایت ایرانی محصولات کدکنیون ( سایت /https://codemilo.ir )
» Cicool – Page, Form, Rest API and CRUD Generator
» KingArchitect | Property Portfolio & Real Estate React Template – No JQuery
» Sheltos – Real Estate React Next Js with Redux Toolkit , React Hooks & API Routes Template
» Acres – Real Estate React Template
» Mingrand – Real Estate React Template
» ChawkBazar – Elementor Lifestyle and Fashion Ecommerce Theme
» Streamit 3.0 | Video Streaming WordPress Theme + RTL
» MagicAI – OpenAI Content, Text, Image, Chat, Code Generator as SaaS
» PHP Form Generator – Codeigniter 4 Form Master, Form Header Detail, User Management, Multi-language
» بروزترین سایت ایرانی محصولات کدکنیون ( سایت /https://codemilo.ir )
» Cicool – Page, Form, Rest API and CRUD Generator
» KingArchitect | Property Portfolio & Real Estate React Template – No JQuery
» Sheltos – Real Estate React Next Js with Redux Toolkit , React Hooks & API Routes Template
» Acres – Real Estate React Template
» Mingrand – Real Estate React Template
» ChawkBazar – Elementor Lifestyle and Fashion Ecommerce Theme
» Streamit 3.0 | Video Streaming WordPress Theme + RTL
» MagicAI – OpenAI Content, Text, Image, Chat, Code Generator as SaaS
» PHP Form Generator – Codeigniter 4 Form Master, Form Header Detail, User Management, Multi-language
تابع زیر می تواند برای فشرده کردن (zip کردن) یک پوشه (Folder) و تمام پوشه ها و فایل های درون آن، به کار رود :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<?php // ساخت یک فایل زیپ از تمامی فایل های یک پوشه function Build_Zip_File_From_A_Complete_Folder($folder_to_zip_path, $destination_zip_file_path){ // Get real path for our folder $rootPath = realpath($folder_to_zip_path); // Initialize archive object $zip = new ZipArchive(); $zip->open($destination_zip_file_path, ZipArchive::CREATE | ZipArchive::OVERWRITE); // Create recursive directory iterator /** @var SplFileInfo[] $files */ $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($rootPath), RecursiveIteratorIterator::LEAVES_ONLY ); foreach ($files as $name => $file) { // Skip directories (they would be added automatically) if (!$file->isDir()) { // Get real and relative path for current file $filePath = $file->getRealPath(); $relativePath = substr($filePath, strlen($rootPath) + 1); // Add current file to archive $zip->addFile($filePath, $relativePath); } } // Zip archive will be created only after closing object $zip->close(); } ?> |