Return Image as response by PHP

To return an image as a request response by PHP you fpassthru function of PHP. I have included a sample code snippet, which will help you to understand how to do this. From the above code snippet, you can see I have opened an image with binary mode by fopen($image, ‘rb‘). And then send that with appropriate headers by header(“Content-Type: image/png”).

Download and then Print PDF File in AngularJS

Sometime developer need to download PDF file and print that pdf document. Here I have shared a code snippet for download pdf then print that pdf using angularJS. $scope.printPdf = function (uuid){ $http({ url : ‘PDF_URL’, method : ‘GET’, headers : { ‘Content-type’ : ‘application/pdf’ }, responseType : ‘arraybuffer’ }).success(function(data, status, headers, config) { var

PSR in PHP

I believe you already heard about the PSR in PHP language. Today I am trying to help you to understand the what is PSR, how and why should we use it. PSR in PHP PSR knock as ‘PHP Standards Recommendation’ which is some recommendations for all PHP programmer when they write their code they should follow some