PHP scripts have the ability to generate HTML, and it is possible to pass information from HTML to PHP.
PHP is a server-side language whereas HTML is a client-side language. So PHP executes on the server side and gets its results as strings, objects, and arrays, and then we use them to display its values in HTML.
This interaction helps bridge the gaps and use the best of both languages.