Below is a diagram showing what happens when an HTTP request is sent by the client to the server.
To delve deeper into code, when an HTTP request is sent from the client side, PHP on the server will only interpret those processes it understand. Anything else is rendered null or, this is denoted as ‘+ foo +’ in the below code;
PHP or Server Languages
PHP languages only exist on the server side of things and basically, handle the processes that need high security. They fetch records from databases and reinforce security in an HTTP connection that is stateless. Server languages are heavily protected and never backend source code to the client on the front end browser.
Client Side languages
Unlike server languages which are heavily encrypted, client-side languages can be easily modified to enhance security or to suit personal preferences.
Thus servers are the only places where PHP processes happen because it’s the only place where PHP files can be interpreted. Once the server is done interpreting and sending feedback back to the client browser, no other process happens unless the client issues another HTTP request.