Skip to content

Tag: php

Using JS variable as the property of HTML input Form

I have a form which have two field “optin” and “Qty”.The quantity field of the form accept the number.The minimum number which can be entered in this field(QTY) depends upon the the value of the Option field i.e. If the option fiels value is red then the minimum value propert of the Qt…

How can I set the database time zone for a query?

I am working on two systems which access the same PostgreSQL database: a Windows exe app, and a Code Igniter PHP web app Both systems output basically the same stuff. One issue I’m having currently is that I need to produce a report of data which is specific to a “location” which is in a dif…

PHP postgres enable ssl support

Sorry to get back to you for a question that has been asked many years ago. But I am really stuck with this. I have a legacy application which is very old, running PHP 5.2.17. I followed this guide to setup my docker container https://andrewscaya.net/blog/bringing-php-52-back-life I have everything setup corr…

Separate date to several intervals

I’ve got an array like the following : And another array : I would like to create a new $array3 that removes the intervals from $array2 in $array1 to give the following result : As you can see, in $array3 2 new entries were added to remove the interval used in $array2. I don’t know how can I tackl…

Countdown For WooCommerce Products

I create function to get the date and turn it to countdown. This my function code: And this my javascript code which is in “countdown.js” file: This code works on single product page, but when I try this in the product archive, it only works on the first product and does not work on the rest produ…

Amount in Words prints values as ones after the decimal point – PHP

I have a PHP function to print amounts in words, It works fine till the decimal, but the later decimal point, it prints the value as of in one’s place. Like, if the value is “54.35”, it prints “Fifty-Four Three Five” Instead, it should print like “Fifty Four Thirty-Five&#82…

Get data from URL using PHP

This is incoming call API URL. so, this URL wont stop loading. this URL keep loading and give data in json format. how to get data from this kind of URL using PHP. Answer Why you used the php CURL to http request. You can use the laravel HTTP client. You can see: https://laravel.com/docs/8.x/http-client#makin…