I have js code which is inside echo statement (which is retried using ajax call). I need to send another ajax request based on the first result. So I need to assign a php variable inside a js variable (php variable is retrieved from database during first ajax call)
echo '<script>
echo '<script>// SEINDINGM REQUEST FOR SELECTED DAY
$("#dayName").on("change", function(){
// GRABBING THE SELECTED VALUE
var day = $(this).val();
var uid=//Here I want to assign the php variable //;
alert(uid);
alert(day);
</script>';