Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question So I am trying to pull data from a website api, they didn’t have any documentation fo…
Tag: php
Sending Link Headers for Early Hints in PHP
Cloudflare has introduced Early Hints based on Link Header. I am a little bit confused about how I should send the link header in my PHP script. As I understand, I should send the Link Header for the links to preconnect I think we can send HTTP 103 Early Hint via PHP headers Is it enough? Answer No, you actua…
How to assert if a phpunit test writes a certain log entry / how to assert if emails are sent
I have a service class in my symfony5 project on php8, which is sending emails following certain rules. With my test want to check if the correct mails are sent. This task exists for several projects, so I really want to find a solution for this. The method, which collects the receiver of the mails is current…
Woocommerce conditionally load a custom product template
I am creating a custom theme and I have copied the file content-product.php to my theme folder. There I have made changes to the html structure and css. I can load of list of products and see the changes working via the short code [products]. However elsewhere on the site I want to display another list of pro…
My Laravel Code running slow because foreach, should i change my query to chunk? and how to optimize it?
The concept is simple that i want to sum some value that name total_hs from table analysis with same workingname. This code running so slow because of foreach if has alot of data. and for model like this Answer You want to return total value for every workingname, If I understand. You can replace your functio…
Convert IIS rewrite to Nginx rewrite syntax?
I’d like to convert an IIS rewrite into Nginx rewrite syntax. I am looking for a way to rewrite a URL like /leaderboard into /pages.php?page=leaderboard. My IIS Rewrite Rule is: Current NGiNX Conf: Answer Matches (see tests):
Datatables Editor show/hide a checkbox of a list of checkbox in edit row when another column is true/false
I’m new in Datatables and Editor. I need help to hide or show some elements of a list of checkbox depends if the boolean “deleted” is true or false. the checkbox are displayed when you edit the row, but i need to display the name of the persons that have his deleted column set to false. I…
Split strings in array to form three-element subarrays
I am practising with the AdventureWorks database for now and I will be receiving strings like the following: SalesOrderNumber=SOH123 and CustomerID=1. The strings may not always contain =, as they may be >, <, >=, <=, !=, <>. Ideally, I would like to split each string into 3 fields – t…
array_push replacing value instead of adding new value in array
I’m trying to make a cart system, which is I need to sum all total product. I’m thinking about saving the total to an array, so I can use array_sum it later. But somehow the array $total_cart[] only have last total, for example is if I have three product in my cart, the total saved in the array is…
Issues creating a PHP webhook for Twilio
So I have the following CURL command in PHP, if I send it https://webhook.site I can extract all the required data in JSON format. Instead of using webhook.site, I would like to create my own PHP webhook client. The code below is the CURL command that works 100% when using webhook.site: I then tried to use PH…