how are you?
I want to structure my code as carefully as possible, but I don’t know how to do it. In a single file, I have PHP, JS and HTML code and I was wondering if it was possible to separate the contents by including their "path" in the html code.
For example, how I can separate the php code as well as the js code:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
{ js code }
{ php code }
</body>
</html>```
Thank you in advance for the information I would receive
You can use '.php' file as default then just put html into that
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="file.js"></script>
<?php include('file.php') ?>
</body>
</html>