抱歉ma问题出了问题,alis有点像alias =“Sri Kumaran Children's Home - CBSENothing就像知识一样纯洁和神圣。”但作为我给出的网址。当我将鼠标悬停在链接上时,它只显示别名= Sri Kumaran Children。如何解决这个问题
$myresult .= "<a href='Schools/{$alias}'><img src='/school/schoolpicdisplay.php?p1={$brand}&p2={$model}' width=\"50\" height=\"80\"></img></a>";
答案 0 :(得分:2)
如果您知道会有单引号,为什么不首先使用双引号?
"...<img src=\"/school/schoolpicdisplay.php?p1={$brand}&p2={$model}\"..."
但是,由于您的$model
将出现在参数字符串中,因此您应rawurlencode
。
$encoded_model = rawurlencode($model);
$encoded_alias = rawurlencode($alias);
$myresult .= "<a href='Schools/{$encoded_alias}'>...p1={$encoded_brand}&p2={$encoded_model}...";