在字符串前面添加"<"时,它不再显示

qin*_*ang 1 php string

当我在字符串之前添加'小于< ' 时,Whan就会发生,因为在我的PHP代码中,前面的字符串已经消失[在我回显它时没有显示] .

E.g:
$search = trim('wdisappear W');  //  all the words were disappeared when < in front
$search = explode(" ", $search); //
$sizeof_search = count($search);  //


for($i = 0; $i < $sizeof_search; $i++){
    $l = strlen($search[$i]);
    echo '<'.$search[$i].'<'.$l;
}
Run Code Online (Sandbox Code Playgroud)

当我在firefox中打开php文件时.'wdisappear W'没有出现!为什么??

我怎么能把

<

在前??

非常感谢你!!

Gol*_*rol 7

那是因为<打开一个html元素.这将导致文本的一部分不可见,因为FF认为它是HTML标记.通过输出&lt;html实体htmlspecialchars来逃避它,或者使用函数来为您转义输出.