Problem showing values in an alert with variable in PHP

0

What I want is to show the content of my variable $serie

alert(<?php echo $serie; ?>);

What happens is that when the value of $serie = '003' if my alert works but if the value is 'FF01' no longer resolves it, apparently it only takes the value of the variable when it is number.

    
asked by Jose Mariano 05.09.2018 в 21:03
source

1 answer

3

Add single or double quotes alert("<?=$serie?>");

    
answered by 05.09.2018 в 21:04