I’ve inherited this script where some sensitive information is stored in the database…and I’m wanting to replace it with ******** before it gets saved and presented in a log. I’m using PHP…and the …
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 ?
Use PHPmailer to send attachment
I’m using PHPmailer library to send emails and I need to send an attachment. Currently the file is stored on the server and I have the link to the file stored in var $link. I’m using the following …
Running javascript inside rest api
I’m working on asterisk. I managed to call an external api using dialplan. Now I want to run a javascript inside that api function, because I need to notify a browser that someone is calling. What I’m …
Search by order item SKU or ID in WooCommerce Orders Admin page
What I am trying to do is to be able to search by order item SKU or ID in the WooCommerce Orders Admin page. What I have found/done till now, but with no success is the following at functions.php file. I suppose the issue is the value of $search_sku at the line with the add_post_meta. I have also tried it
Track Shoutcast streams in Google Analytics
Is there a way to track Shoutcast streams in Google Analytics? So for example, each time someone listens to the stream, it records that as a pageview in Google Analytics? I suspect it might result in modifying the Shoutcast server code, but I’m wondering if anyone has done this before, or could point 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…
Warning: Shipping method required – OpenCart
Ran into this problem a while back. Been scouring the web, OpenCart forums, StackOverflow for weeks now trying to get this sorted. Basically I took Flat Shipping module and made a copy of it. Renamed …
Blade: escaping text and allowing new lines
I have a user-input text displayed on one of the pages. I want to allow new lines, though. How do I display the text, so it is escaped AND allows new lines? I used nl2br() and Blade’s tripple …