织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

Convert nu欧博注册mber to string in php

时间:2025-08-23 19:38来源: 作者:admin 点击: 1 次
It's failing because it's prefixed with a 0, making PHP attempt to interpret it as an octal number, where 8 is not a valid octal digit as it parses th

It's failing because it's prefixed with a 0, making PHP attempt to interpret it as an octal number, where 8 is not a valid octal digit as it parses the string, so you get 0.

The solution is to use a (string) cast or strval(), but you need to remove the leading zero from your definition of $code.

$code = 87326487326; var_dump( $code, (string) $code, strval( $code));

This will output (on an x64 machine):

int(87326487326) string(11) "87326487326" string(11) "87326487326"

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-08-24 04:08 最后登录:2025-08-24 04:08
栏目列表
推荐内容