I am using this code in my controller and it's not working, showing parse error. Can you guys please help me out.
echo "<script>
alert("<?php echo $v[$keys[$i+4]],"is going out of stock"; ?>");
</script>" ;
Thank you!
I am using this code in my controller and it's not working, showing parse error. Can you guys please help me out.
echo "<script>
alert("<?php echo $v[$keys[$i+4]],"is going out of stock"; ?>");
</script>" ;
Thank you!
You're not concatenating the static text correctly. Try this:
echo "<script>
alert('" . $v[$keys[$i+4]] . " is going out of stock.');
</script>" ;