开发者

Less-than operator failing in a PHP string

var_dump('<a>')
// or
var_dump("<a>")
// or
var_dump("\x3Ca>")开发者_StackOverflow社区

// all result in
string(3) ""

What is going on? Only putting a space after the less-than sign works for me.

PHP Version 5.2.10-2ubuntu6.4


The <a> is probably getting rendered as an empty tag in the browser - try viewing the page source


I believe var_dump takes an expression, not a string. So:

<?php

$a = "<a>";
var_dump($a); 

?>

Should work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜