PHP Tutorials

How to create a zip file in php

How to create a zip file in php




In this post am going to explain, how to create a zip file in PHP of multiple files and force download the zip file. It is useful for some web projects, that providing the documents according to the selection of files like PDFs, images and docs etc and you can choose the files and download it in zip format. Here is a simple php code to create a zip file …

Continue reading




Zend custom controller helper




An action helper is a class that plugs into the controller to provide services to actions. They expand a controller’s functionality without using inheritance and so can be reused across multiple controllers and projects. To add Zend custom controller helper we can add it in library. Here I am creating a custom library for our purpose with the namespace ‘App’, so need to add it in application.ini to autoload these. …

Continue reading




Sort multidimensional array




To sort multidimensional array by values, you can use a user-defined comparison function usort. The function sort array by its values using a user-defined comparison function. If you want to sort an array by some non-trivial criteria, you should use this function. For example we have an array to sort: We need to sort this array according to the time in ascending order. So we need to use a user-defined …

Continue reading