-3

I have a Javascript function that saves the value from checked input from a div in an array. And I want to pass this array to PHP. Is it possible? And if it is, how can I do?

Lucas Bastos
  • 39
  • 1
  • 6

1 Answers1

1

You cannot pass variable values from the current page javascript to the current page PHP code since PHP runs in the server and it cannot know what is going on on the client side.

You may use different methods to get a response from the server using javascript variables, such as AJAX or dynamic server calls. Here's an example how to do it.

Niche
  • 967
  • 5
  • 23