Category "php"

Filter WooCommerce products with post__in and additional meta queries

I am trying to find products that are on sale (including product variations) in addition to another meta_query of price under X. The wc_get_product_ids_on_sale(

Unable to match results of php hash_hmac() and coldfusion hmac()

I am working on encrypting a URL and converting a working script from PHP to ColdFusion. I have completed 95% of the work but I am stuck at this point after try

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

I'm using PhpSpreadSheet and I need to save the sheets contained in a workbook as individual CSV files. I've tried to use $reader->setLoadAllSheets(); but

backup files to google drive using PHP

I have a server and a domain name on GoDaddy. I want to create a backup for my files to be uploaded on Google Drive So that all my files and my database have

Cut an arabic string

I have a string in the arabic language like: على احمد يوسف Now I need to cut this string an

PHP Java bridge exception - protocol error

I am running the PHP-Java bridge server (apache-tomcat). Sometimes I get an intermittent error. It's working when I restart the tomcat server from /opt/apache-t

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

I have a local PHP7 & Apache environment on my Mac. All my scripts from one site are showing this error at the end of the page: Warning: Unknown: Failed

How to to send mail using gmail in Laravel?

I try again and again to test sending an email from localhost but I still cannot. I don't know anymore how to do it. I try search to find solution but I cannot

Laravel get user data with profile

I have user and profile models with followers/following. What I want is to get the User data with the Profile data merged when calling Profile::followers. Now I

Google API Heatmap Layer exception, why?

I want to pass the heatmapdata array for my Heatmap Layer from my PHP file. When running my code (below) I get the following exception: Uncaught TypeError:

MISSING UPDATES FOR: MEDIA Drupal 9

I have started facing an issue with locally hosted Drupal 9 (Xampp, Windows 10). The issue started when I was trying to create events in drupal 9 and I was redi

virtctl works when executed via command line but not from php exec()

I am trying to run kubectl virt commands to manage my virtual machine via PHP. First, I log in to my server with phpseclib with the following code: $ssh = new S

Adding hreflang tags automatically in WordPress subdirectory multisite

We have a WordPress MU subdirectory network setup: www.example.com - main website, USA, global www.example.com/uk/ - to display for UK visitors www.example.com/

Symfony 4: how to safely 'join' migrations together? / remove migrations in between the first and last?

I was recently tweaking around with my DB and noticed that I made 5 migrations on top of my existing 2. So 7 in total, m1, m2, ..., m7. From these 5, I only wan

Custom WooCommerce shortcode to display product image gallery

I have been tasked with duplicating a WooCommerce product gallery in an internal page (not a product page). As such, I decided to create a Child theme and write

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php on line 10 Notice: U

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

I made import data using Excel on Laravel Maatwebsite Excel 3.1. but when in the database there is the same data (Primary Key) then there is an error message

Installing Composer - Internal Error

I have trouble installing Composer. After I select the php.exe path in the wizard and next thing it shows is the below error description. The PHP exe file

PHP: Telegram Bot: Insert line break to text message

"\n" and "\r\n", tested in text message sent by telegram bot, to create line break. Instead of showing line break, underline _ will appear after using them.

Prestashop webservice API creating cart rules

Have been trying to create a cart rule using Prestashop web-service with no luck. Tried this https://github.com/PrestaShop/PrestaShop-webservice-lib/blob/mast