Jump to content

echo '<a href="$var1">$var2</a>'; why won't this work?


Aro2220

Recommended Posts

Hi, I am trying to get the following script to run but it doesn't put the values of the variables into the echo...

 

echo '<a href="$var1">$var2</a>';

 

result is an html link called $var2 that links to $var1

 

if i echo "$var1";

or

echo "$var2";

i get the value of the variable displaying correctly.

 

Why is this happening?

How do I do what I want to do?

Link to comment
https://forums.phpfreaks.com/topic/165298-echo-var2-why-wont-this-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.