I have JavaScript code I added it in a php variable But I want to implement it first and then take the information Example
$nam = "<script>
document.write(5 + 6);
</script>";
I want to execute the code and show the results in another variable to put in the database
INSERT INTO pro SET nam='$nam'
and I tried to use but failed
$nam = echo "<script>
document.write(5 + 6);
</script>";