问题描述:

how can i put a ID on this

<?php echo anchor('profil', 'Profil'); ?>

i wanna echo a username ID to it like

<a href="profil.php?id=<?php echo $id; ?>">Profile</a>

网友答案:
echo anchor('profil.php?id='.$id, 'My News');

but you'd better use the CodeIgniter router and place the id as parameter, e.g:

echo anchor('profil/'.$id, 'My News');

this will output a link like:

http://www.site.com/profil/233
相关阅读:
Top