Home » Php » How do I call my Javascript inside my other PHP file class

How do I call my Javascript inside my other PHP file class

Posted by: admin February 25, 2020 Leave a comment

Questions:

i will try to create a language converter in using PHP but I don’t understand how to I call my js code in PHP class !!!

<?php 
     require_once __DIR__.'/src/Unicode2Bijoy.php';
?>



<script>

function myfunction(){
    var uni1_val = document.getElementById('uni1_val').value;
    console.log(uni1_val);

   var bijoy_result = <?php echo mirazmac\Unicode2Bijoy::convert($str) ?>;
   console.log(bijoy_result);
}
</script>

how can i call this class and result show in my console

How to&Answers:
echo"<script>myfunction();</script>";