Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use PHP inside the Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 235
    Comment on it

    Hello Reader's!. If you having the JS file and you need to do some php coding inside the file, Then you can use the following coding standard:-

    <script type="text/javascript">
    var jsVvariable = <?php echo json_encode($phpVariable); ?>;
    </script>
    

    Just like the code above you have to put php code in between the <?php ?> tags

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: