Skip to content

Tag: php

How to add TTF font to html2pdf PHP program

I’m trying to use HTML2PDF 4.03 with this code: Now the program die with this: How can I add TTF font to my PDF file? Answer I have managed to add 1 custom font to my setup using the following method. First convert the .ttf file to 3 separate files (.php .z and .ufm) using the following font converter P…

Convert CSV to JSON using PHP

I am trying to convert CSV file to JSON using PHP. Here is my code print_r($result); // I see all data(s) Then I json_encode($result); and tried to display it, but nothing is displaying on the screen at all. All I see is the blank screen, and 0 error message. Am I doing anything wrong ? Can someone help me ?

Default to Laravel File cache if redis is down

In the spirit of “chaos monkey” I’m trying to ensure that a laravel application keeps going even when the services it depends on are down. It uses a DB for primary storage, and a redis cache. What I’d like to do is have it automatically fall back to the file cache if and when redis fai…