Jump to content

How to Pass Simple PHP variable to jQuery


Recommended Posts

Hi there,


I am working on a php web form.


I have a variable named $isFruit having value of 1


When I do a:




It gives me value as 1, which is good.


Now I need to pass this php variable into a jquery function:


$('document').ready(function() {         
  //I need to get the value of $isFruit variable here


How can pass the php variable into this function.


Kindly reply.


All comments and feedbacks are always welcomed.


Thank you! :)

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.