日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

php true true true,php-为什么此评估为true

發布時間:2023/11/27 生活经验 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php true true true,php-为什么此评估为true 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

標簽:php

乳清這算是真的嗎?

$val2=0;

//outputs that is an error123

if($val2=='error123'){

echo 'that is an error123
';

}else{

echo 'that is not an error123
';

}

解決方法:

您正在將字符串與整數進行比較.為了進行比較,首先將字符串轉換為整數.當“ error123”轉換為整數時,它變為0.

echo intval("error123");

結果:

0

If you compare a number with a string or the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically.

有一個快速參考頁PHP type comparison tables,向您顯示各種比較的結果.請參閱表格“與==的寬松比較”.關于這個問題,有趣的部分是0 ==“ php”顯示為TRUE.

如果您不希望類型變戲法,請使用===而不是==.

標簽:php

來源: https://codeday.me/bug/20191012/1900902.html

總結

以上是生活随笔為你收集整理的php true true true,php-为什么此评估为true的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。