Reading javascript variables from php: variable is not updating after submit

I have a variable in javascript and i want to access this variable in my php code and assign to other variable and print.

Below is my code, but after click on submit my jvalue variable is not updating with new value (‘inside button click’) after click on submit, its printing old value (‘this is javascript value’) only. but in the alert jvalue is showing “inside button click”…and echo $abc is printing old one…
i want after submit to print jvalue as “inside button click”…

            <html>
            <head>
            <button onclick="myFunction()">Click me</button>

            <form action="speech_to_text_v2.php" method="post" enctype="application/x-www-form-urlencoded">
            <button type="submit" >Submit</button>
                
            </form>

            <!-- </uidiv> -->
            <p id="demo"></p>
            <script>
            var jvalue = 'this is javascript value';

            function myFunction() {
            document.getElementById("demo").innerHTML = "Hello World";
            jvalue='inside button click';
            alert(jvalue);
            }

            </script>
            </body>
            </html>
            <?php $abc= "<script>document.write(jvalue);</script>";
            echo $abc;

            ?>