Skip to content

Tag: php

PHP data array coding [closed]

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…

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…

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…