Home >Backend Development >PHP Tutorial >PHP String 转int的问题

PHP String 转int的问题

WBOY
WBOYOriginal
2016-06-06 20:40:50978browse

<code><?php $a=012;
echo (int)$a;
echo  $a/4;
</code></code>

为什么$a被转成了10???

回复内容:

<code><?php $a=012;
echo (int)$a;
echo  $a/4;
</code></code>

为什么$a被转成了10???

数字0开头,是8进制

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn