thaidomizil Posted June 14, 2011 Share Posted June 14, 2011 Hi, i'm trying to get a link shown in some echo, but it just won't work, i tried like this: <?php echo 'The link goes<a href="bezahlung.php?id=$id">here</a>.'; } ?> on the site the link shows as that but the $id should change to the $id value. What am i doing wrong ? Quote Link to comment https://forums.phpfreaks.com/topic/239377-link-in-echo-value-from-array/ Share on other sites More sharing options...
mikesta707 Posted June 14, 2011 Share Posted June 14, 2011 PHP variables aren't interpolated in single quotes. You want to use double quotes echo "The link goes<a href=\"bezahlung.php?id=$id\">here</a>."; Quote Link to comment https://forums.phpfreaks.com/topic/239377-link-in-echo-value-from-array/#findComment-1229789 Share on other sites More sharing options...
redixx Posted June 14, 2011 Share Posted June 14, 2011 Or concatenate: <?php echo 'The link goes<a href="bezahlung.php?id=' . $id . '">here</a>.'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/239377-link-in-echo-value-from-array/#findComment-1229790 Share on other sites More sharing options...
thaidomizil Posted June 14, 2011 Author Share Posted June 14, 2011 Thanks to both of you, it's working now. Quote Link to comment https://forums.phpfreaks.com/topic/239377-link-in-echo-value-from-array/#findComment-1229792 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.