开发者

codeigniter anchor set a ID

开发者 https://www.devze.com 2023-01-23 17:26 出处:网络
how can i put a ID on this <?php echo anchor(\'profil\', \'Profil\'); ?> i wanna echo a username ID to it like

how can i put a ID on this

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

i wanna echo a username ID to it like

<a href="pro开发者_运维百科fil.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
0

精彩评论

暂无评论...
验证码 换一张
取 消