php

PHP migration issue

I am deploying a website (second time around). I edited nano .env, but when I try to migrate it comes back with:
The environment file is invalid!
Failed to parse dotenv file. Encountered an invalid name at [nano .env].

I tried to put NAME…

How to get a date at 0h 0m 0s?

I want to get the date at 30 days ago :
$one_month_ago = date_create("now");
date_sub($one_month_ago, date_interval_create_from_date_string(’30 days’));

I want $one_month_ago to have its hour part, minute part and seconds part t…

Nested API calls in PHP

I am calling an API endpoint to get a list of domains:
/v2/domains

Within this result I need to make another call to get the domains details:
/v2/domains/{domainName}

This currently happens inside a foreach loop which makes the process t…

What does $this refers to when used without ->

$this is used internally in a class to point towards internal methods or properties with $this->method();
However in WordPress code, I noticed:
class ABC{
function efg(){
do_action(‘hookname’, $this);
}
}

What is $this on its own s…