Category "php"

How to add width and height to Wordpress Gutenberg image block output?

Default Gutenberg Image block i HTML output has no height="xxx" and width="xxx" parameters: <div class="wp-block-image"> <figure class="aligncenter si

PHP SOAP insert data StructType wsdltophp

I am working in a project where I must call SOAP WS. I used WSDLtoPHP, that's really helpful. I can READ data, and now I would like to create new item with the

Cant save webp format with imagick

Im developing a panel in which Im uploading a jpg, it copies it, resizes it, saves another jpg and now I want also to be able to create a copy but using webp ex

Load a .env file with PHP

I'm currently coding on a pure PHP project and I need to load an .env file to get some variables. After a bit of searching I turned to the vlucas/phpdotenv plug

Dynamic themes selection by user(PHP) from multiple theme

I want to add dynamic themes to my php website which will be stored from the user's database and next time when user uses the website that theme should be shown

How to debug in WooCommerce 3+

I am creating a custom shipping method for Woocommerce using this tutorial https://docs.woocommerce.com/document/shipping-method-api/ but I am having issues deb

Laravel Livewire: jQuery not working in child component loaded via @if statement

I'm using Laravel 8 and PHP 8 and livewire 2. I have a Fullpage Livewire component. I have a button, to toggle a simple flag between false and true. <Button

Webscraping Symfony/Panther: Can't get HTML

I want to scrape a site with the symfony panther package within a Laravel application. According to the documentation https://github.com/symfony/panther#a-polym

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

I've just deploy a new laravel 7 application on AWS Elastic beanstalk. I've noticed they changed the Apache server to Nginx server. https://docs.aws.amazon.

How to write PHP in XSLT

I have been trying for the longest time to write a simple php echo statement in a .xsl file, but every site that I look at does not seem to function for me when

Add customer email and phone in "Order" column to admin orders list on Woocommerce

I am trying to find a way on how to add the customer phone and email below the name on the WooCommerce order view. See picture for reference where I need to ad

file_get_contents('php://input') not working. Empty - NULL

I having this problem for the last 12 hours, i read about 50 articles, 50 questions here, i can't fix it. I will be more precise, i want others get the solution

Does magento 2.4.4 works on php 7.4

I am planning to upgrade my magento version from 2.4.3 to 2.4.4 Will the new magento version 2.4.4 works well on php 7.4? Or it requires php 8 only

Laravel phpunit test failing authorization

I have a working api only application. I am required to write a test decided to use laravel's phpunit test. This simple app allows only authenticated users ca

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

I am new in PHP and when I am trying to connect my database with PHP it is showing error Uncaught PDOException: PDO::__construct(): php_network_getaddresse

Access relation of pivot table in Laravel

I have three models Bill, Product and Process. Bill has a ManyToMany relationship with Product and the pivot table have some extra fields. I write the Bill mode

How to override htaccees file for cache control header

In my company we have htaccess file in which there is no web caching enabled,I want to enable caching for one single api but htaccess file is overriding my cach

Transform array, set each array element with parent key php

I am receiving data that is an array of elements that contains an array of tags by language like this [ { "1": "tag_es1;tag_es2;tag_es3", "2": "tag_e

How to create a cookie to store the timestamp of when a page is first loaded with php

I would really appreciate any help if possible! This is the question: Use a cookie (NOT PHP SESSION) that expires a year from now to do the following: Record th

How to loop a tree array with unknown depth and get array blocks?

I found this solution to loop and print an unknown depth array: printAllValues($arr); function printAllValues($arr) { if(!is_array($arr)) {