• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

38
Views
am getting unexpected identifier when calling a PHP fucntion inside js

I have a PHP file like this:

<?php
include 'fonctions.php';
echo get_nom_prenom_chauffeur(26);
?>
<body>
  <h1 id="header"></h1>
  <script>
    var result = <?php print_r (get_nom_prenom_chauffeur(26))?>;
    //document.getElementById("header").innerHTML = result;
    console.log(result);
  </script>
</body>

but when it's executed am getting the following error :

enter image description here

althought the PHP function is working and give me the right result but i can't return it or handle it in javascript.

Any help would be appreciated, thanks

about 1 month ago ·

Juan Pablo Isaza

Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.