Search code examples
phphtmlquotes

Quotation marks in value of html tag attribute problem


<?php    
$myname = 'my name have quotation marks " <- here';
?>

And i try to:

<input type="text" name="newnameproposition[<?php echo $myname ?>]">

And html have a little problem becouse of:

name="newnameproposition[my name have quotation marks " <- here]"

Can anybody had this kind of problem?


Solution

  • Take a look at htmlentities()