当前位置:网站首页>Convert Boolean to integer value PHP - Convert Boolean to integer value PHP
Convert Boolean to integer value PHP - Convert Boolean to integer value PHP
2022-07-05 04:08:00 【fyin1314】
problem :
Is there any builtin function for PHP that will take a boolean value and return its integer equivalent?PHP Is there any built-in function that will take a Boolean value and return its equivalent integer ?0 for FALSE, 1 for TRUE?0 representative FALSE,1 representative TRUE?Of course you can easily create a function to do so, I'm just asking if there is a builtin function inside of PHP. Of course, you can easily create a function to do this , I'm just asking PHP Is there a built-in function inside .I already tried intval()
and casting it to (int)
but they didnt work, they return 0 in both cases of TRUE and FALSE. I've tried intval()
And convert it to (int)
But they don't work , They are TRUE and FALSE Return in both cases 0.
Edit : the problem was that it wasnt really a boolean, it was a string "false", "true", php didnt detect the jquery post that it passed a boolean. edit : The problem is that it's not really a Boolean , It's a string “false”、“true”,php It was not detected that it passed a Boolean jquery post .problem solved, thanks ! Problem solved , thank you !
Solution :
Reference resources : https://stackoom.com/en/question/1MEFY边栏推荐
- 输入的查询SQL语句,是如何执行的?
- Deflocculant aminoiodotide eye drops
- [wp][introduction] brush weak type questions
- Clickhouse materialized view
- Common features of ES6
- Rust blockchain development - signature encryption and private key public key
- The scale of computing power in China ranks second in the world: computing is leaping forward in Intelligent Computing
- Threejs rendering obj+mtl model source code, 3D factory model
- 3. Package the bottom navigation tabbar
- Scheduling system of kubernetes cluster
猜你喜欢
【看完就懂系列】一文6000字教你从0到1实现接口自动化
Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
Pyqt pyside custom telescopic menu bar sharing (including tutorial)
Alibaba cloud ECS uses cloudfs4oss to mount OSS
一文带你了解BI的前世今身与企业数字化转型的关系
Realize the attention function of the article in the applet
【刷题】BFS题目精选
小程序中实现文章的关注功能
[brush questions] BFS topic selection
Rust区块琏开发——签名加密与私钥公钥
随机推荐
“金九银十”是找工作的最佳时期吗?那倒未必
Containerd series - what is containerd?
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
The order of LDS links
Mixed compilation of C and CC
Clickhouse synchronization MySQL (based on materialization engine)
Use of vscode software
Summary of scene design
行为感知系统
[untitled]
A应用唤醒B应该快速方法
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
根据入栈顺序判断出栈顺序是否合理
[untitled]
BDF application - topology sequence
【刷题】BFS题目精选
UI自動化測試從此告別手動下載瀏覽器驅動
线上故障突突突?如何紧急诊断、排查与恢复
在线SQL转Excel(xls/xlsx)工具