@nvsr I'm back from holidays and had a look at those problems but I have questions.
- This is the standard form of assigning a value to a associative array,isn't it?In which way should I do it if not in this?Using array_push() would only make sense for numbered arrays.
- Which form of sanity checking do you think I need at this point?First checking that $response exists and is an array,then checking that for ['html'] and so on?Or do you mean something else?
@halcyon welcome home! I hope you had a great vacation.
* The prefered way to setting associative array values is $arr['foo'] = "bar"
* Checking whether the response matches what you expect should do the trick!
@nvsr I don't see a real difference between $parameters[CURLOPT_POSTFIELDS] = http_build_query($data); and $arr['foo'] = "bar";.As key I use a constant instead of a string and as a value I use a function instead of a string but both should be fine as far as I know.Can you please further explain where you locate the error?
For the second problem,I see what you mean and will do that.
@halcyon interestingly it seems that those constants were not defined when I ran the code. Oddly enough I do have curl enabled so I'll look into it some more after I get home from work.
@nvsr cURL option constants should be set by PHP automatically.You can find a list of them here: https://www.php.net/manual/en/function.curl-setopt.php
Mastodon server for anyone interested in CSS or general web development