There are several scenarios supported by Azure AD, depending on what you are using Azure AD for. Basically, to access resources through Azure AD from a PHP web application, you can refer to the Web Application to Web API section to understand this scenario and get you started.
In order to integrate Azure AD into PHP web applications, we need to follow the steps in the flow of providing the authorization code to create several custom HTTP requests. EG. To get an access token through the OAuth 2.0 protocol, we must refer to the steps "Providing an authorization code" , as a rule, we will create 2 HTTP requests to get an access token:
1, Request an authorization code 
The extension URL will be redirected to the sso page, after logging in we will get the code value, which will be used in the next step.
2, use the authorization code to request an access token: 
Then we can use the access token to add a JWT string with the designation "Bearer" in the authorization header of the web resource API request.
Here is the PHP testing project provided by Azure for your reference.
source share