There is a php function that does some database and curl operations. I run this function with a url. Right now I’m doing this manually, but I’ll tie it to crons in the future. My problem is this. For example, I have a url like below. When I enter to this url, the function I direct inside deletes data from
Submit and POST “True” or “False” to a series of text questions presented one by one taken from a php array
new to forum, AJAX and JQuery. A little experience of PHP and JS. I’m trying to present a long series of questions (400+) one by one in an input text field on a form with 2 submit buttons labelled “True” and “False”. I need one question to be presented at a time, then record the True or False result as
cURL issue with Google consent redirect
I’m running into an issue with cURL while getting customer review data from Google (without API). Before my cURL request was working just fine, but it seems Google now redirects all requests to a cookie consent page. Below you’ll find my current code: $result now just prints “302 Moved. The document had moved here.” I also tried setting curl_setopt($ch, CURLOPT_FOLLOWLOCATION,
php json parse access child values
I’m trying to filter and later access to the child data of a nested json file using PHP but for now i’m unable to do it. Json example: I’ve tried with this code: So $domain_id is an external value that I passed through the function. The idea is that if it matches one of the child’s values, then I can
number_format in between strings
I am new to php and I have this code that will supposedly display floating numbers with comma. I have the following part of my code. Answer
Decode string with x in PHP that has char encoded over 255
My problem is about string decoding. Let’s assume a string like: I want to decode it and to look like that: λƛ¬∧⟑∨⟇÷ €½∆ø↔¢⌐æ I tried to use But it’s not what was expected. In python something like that works: Answer You don’t need to decode that. This is legal notation for strings in PHP. https://3v4l.org/0e0Po
php DOMDocument preg_replace fail detect
Basically, I want to replace content with hyperlink when detected matching keyword tag. the replace need to be outside of caption/image/figure/figcaption/iframe/a of existing content, because putting hyperlink inside these will causing format breaking. my php Now I facing 2 issue want to exclude replace hyperlink tag into but it fail on regex.. currently it display like this… this DOMDocument loadHTML
PHP Compare 2 Timestamps Logic
I’m working with an API that generates a token that I use for subsequent requests that is valid for 15 minutes. I’m storing a timestamp when the token is first generated and adding 15 minutes to this and storing that as a session variable like this: When I make a subsequent call to the API I’m checking to see if
PHP Null Coalesce combined with ternary has unexpected results
This is tested against PHP 7.4 I’m trying to understand why the first example does not return ‘hello’ like the other two. Example 3 is the same thing as example 1 except the ternary is encapsulated in parentheses but for some reason the presence of the parentheses on example 3 give the expected result. Example 2 is the same as
Form doesn’t take me to action url when submitting
When I submit my form it doesn’t take me to the right url, it instead just stays on the same url and adds the params to it. Like this: /todo?message=themessage rather than what it should be as /todo/add In my /todo/add url, I have a php script that is assigned to that route, which just echos a string and nothing