Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

329
Vistas
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 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda