所以我收集最近浏览过的页面的代码是
<?php
session_start();
$currentpageurl = $_GET['username'];
$_SESSION['pageurl'][] = $_SERVER['REQUEST_URI'];
if( count( $_SESSION['pageurl'] ) > 10 ){
array_shift( $_SESSION['pageurl'] );
}
foreach( $_SESSION['pageurl'] as $key=>$value) {
echo 'The value of $_SESSION['."'".$key."'".'] is '."'localhost".$value."'".' <br />';
}
?>
,显示它的代码是
<?php
session_start();
foreach( $_SESSION['pageurl'] as $key=>$value) {
echo 'The value of $_SESSION['."'".$key."'".'] is '."'localhost".$value."'".' <br />';
}
?>
问题是我只需要将url显示为文本即可点击它: $ _SESSION [&#39; 0&#39;]的值是&#39; localhost / works.php&#39;
我将如何使其可链接
答案 0 :(得分:0)
echo '<a href="'.$_SESSION['0'].'">Click here</a>';