I would like to be able to create a link using a variable (which changes depending on what is outputted from the a database). So if $name = dave, I would like to be able to say:
www.example.com/$name
which would be the same as:
www.example.com/dave
I have tried the following
foreach($query->result_array() as $row) {
$name = $row['user_username'];
echo anchor('User/view/$name', '$name');
}
but get the following error:
The URI you submitted has disallowed characters.
Thanks in advance for any help.