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 ? 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>."; 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>.'; } ?> 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. 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
Archived
This topic is now archived and is closed to further replies.