Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3239952
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:01:47+00:00 2026-05-17T18:01:47+00:00

I believe it is possible to execute a java script function within PHP, but

  • 0

I believe it is possible to execute a java script function within PHP, but will it then remain server side as opposed to client side? Can I, within PHP, call a .js function, passing it some args, and have it return to the PHP that called it?

A script I want to use returns XML, and I want to get the user inputs using PHP, pass them to the .js function residing on the server, then take the returned xml and parse it back in the PHP part.

I ask because I see people commenting that because .js is client side and PHP is server side, they don’t get along. I was hoping that by executing the .js function in the PHP, I could spoof the .js call as coming from the local machine (the server).

Thanks for any information!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:01:47+00:00Added an answer on May 17, 2026 at 6:01 pm

    You cannot call JavaScript from within PHP itself. PHP is not a JavaScript engine.

    However, there is a PECL Extension for interfacing with V8:

    • http://php.net/manual/en/book.v8js.php
    • http://we-love-php.blogspot.de/2012/07/using-v8-javascript-engine-as-php.html

    And you can interface with a (serverside) JavaScript engine. Have a look at node.js and

    • Recommendation for integrating nodejs with php application
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I believe this is possible but I haven't done it before. I need to
I believe subj is possible. If yes, then how to do it? If not,
In bash, I believe it is possible to enable tab completion on the terminal
I believe I've looked everywhere possible and already feel to silly because I spent
I have been lead to believe that it is possible to pass a class
Is is possible to install a gadget to a user's desktop somehow? I believe
I have a query that I want to execute that fastest possible. Here it
Is it possible to call a function defined in a non-specialised template class from
Possible Duplicate: Output (echo/print) everything from a PHP Array I have done a query
In the old Google Chart API it was possible to use PHP to render

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.