This question already has answers here:
What is the difference between client-side and server-side programming?
                            
                                (4个答案)
                            
                    
                3个月前关闭。
        

    

我将尝试使用PHP创建语言转换器,但我不明白如何在PHP类中调用我的js代码!

<?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>



  我如何在我的控制台中调用此类并显示结果

最佳答案

echo"<script>myfunction();</script>";

关于javascript - 如何在其他PHP文件类中调用Javascript ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/60280665/

10-12 02:30