在PHP变量中使用以0开头的数字 [英] Use numbers starting with 0 in a variable in php

查看:530
本文介绍了在PHP变量中使用以0开头的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在$ number中保存一个010号,如果我喜欢这个php,它将删除开头的0

Hi i need to save a 010 number in $number and if i do like this php will remove the starting 0

    $number = 010 

此回显将返回10,我如何使其不删除初始的0

And echo of this will return 10 how can i make it not to remove the initial 0

BR 马丁

推荐答案

将其用作字符串:

$number = '010';

这篇关于在PHP变量中使用以0开头的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆