html中的textbox数字类型如果在php中发布表单,则截断0


textbox number type in html cut off 0 if post form in php

如果我给文本框类型作为数字并提交一个表单,它会截断0。

例如:099921意味着它将作为99921 发布

为什么它切断了前面的0

因为前面的0没有任何意义,因此被删除。将其设为字符串(文本),它将保持不变。Ints前面没有0。

    i dont know why but i did the same code and it is displaying the value with o i.e 099921 
check out my code
<?php
if(isset($_POST['submit']))
{
    echo $numberValue = $_POST['numVal'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form method="post">
<input type="number" name="numVal" value="" />
<input type="submit" name="submit" value="submit"/>
</form>
</body>
</html