I saw in another post in stackoverflow that it was possible to include PHP code in HTML tag but I have this error: "Undefined index: select_years" when I use this code :
<script type="text/javascript">
console.log(<?php echo $_POST["select_years"];?>);
</script>