PHP变量作为超链接

PHP变量作为超链接,php,html,hyperlink,isset,Php,Html,Hyperlink,Isset,我正在尝试设置链接到文件夹index.html中我的一个页面的php变量。但是,我得到了一个错误Name&lang=en”>有什么帮助吗 if (isset($result_array)) { foreach ($result_array as $result) { $name = preg_replace("/" . $search . "/i", "<b class='high'>" . $search . "</b>", $result['N

我正在尝试设置链接到文件夹
index.html
中我的一个页面的php变量。但是,我得到了一个错误
Name&lang=en”>
有什么帮助吗

if (isset($result_array)) {
    foreach ($result_array as $result) {
        $name = preg_replace("/" . $search . "/i", "<b class='high'>" . $search . "</b>", $result['Name']);
        $url = '<a href="index.html">' . urlencode($result['Name']) . '&lang=en';
        $out = str_replace('nameS', $name, $html);
        $out = str_replace('urlS', $url, $out);
        $_SESSION[$search] = $result['Name'];
        echo($out);
    }
}
if(isset($result\u数组)){
foreach($result\u数组作为$result){
$name=preg_replace(“/”$search./i“,“.$search.”,$result['name']);
$url=''.urlencode($result['Name'])。&lang=en';
$out=str_replace('nameS',$name,$html);
$out=str_replace('url',$url,$out);
$\会话[$search]=$result['Name'];
echo($out);
}
}

您期望的url是什么?index.html。但我想显示结果的名称并将其超链接到index.html
$url='';
试试这个或
$url='';
试试这个都不行:(您期望的url是什么?index.html。但是我想显示结果的名称并将其超链接到index.html
$url='';
试试这个或
$url='';
试试这个都不行:(