Skip to content
Advertisement

how can i add ” to a variable in php?

so I’m trying to make a variable that contains a ” sign like if i had a variable called $x i want my variable

$y = """ , $x , """

but i can’t just write “”” so what is the method of adding a ” to a variable

im using php 5 but i don’t think that’s gonna help i mean im justwriting more because this site doesn’t allow me to post but i can’t explain more and i cant find my answer in another place and again more writing yada yada , some questions are small so WHY just WHY does it think it’s incomplete

Advertisement

Answer

You can do it like this

$x =11;
$y = '"""'.$x.'"""'; 

echo $y;

Result “””11″””

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement