I am trying to get a value assigning in Javascript variable directly using PHP-JSON as following
var productVatValue = <?php echo json_encode($productVatValue) ?>;
I have also tried solution
var productVatValue = <?php echo json_encode($productVatValue, JSON_HEX_TAG); ?>;
from the post here How do I pass variables and data from PHP to JavaScript? but same error " parsing error unexpected token < " is showing on the line -- how I can solve the error?