好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

PHP empty、isset、is_null的区别

empty()和isset() 只能用于变量,因为传递任何其它参数都将造成解析错误。若想检测常量是否已设置,可使用 defined() 函数。

is_null可以用于变量,值和表达式。

empty

bool empty ( mixed $var )
//判断一个变量是否被认为是空的。
//当一个变量并不存在,或者它的值等同于FALSE,那么它会被认为不存在。
//如果变量不存在的话,empty()并不会产生警告。

如果 变量 是非空或非零的值,则 empty() 返回 FALSE。换句话说,""、0、"0"、NULL、FALSE、array()、var $var、未定义;以及没有任何属性的对象都将被认为是空的,如果 var 为空,则返回 TRUE。

isset

bool isset ( mixed $var [, mixed $... ] )
//检测变量是否设置,并且不是 NULL。

如果 变量 存在(非NULL)则返回 TRUE,否则返回 FALSE(包括未定义)。变量值设置为:null,返回也是false;unset一个变量后,变量被取消了。注意,isset对于NULL值变量,特殊处理。

is_null

bool is_null ( mixed $var )
//如果 var 是 null 则返回 TRUE,否则返回 FALSE。

检测传入值【值,变量,表达式】是否是null,只有一个变量定义了,且它的值是null,它才返回TRUE . 其它都返回 FALSE 【未定义变量传入后会出错!】

在下列情况下一个变量被认为是 NULL:

  1. 被赋值为 NULL。

  2. 尚未被赋值。

  3. 被unset()。



点赞0
 标签: php empty isset is_null
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
frozentissue
 frozentissue 2019-03-18 16:17回复
#255
<a href="http://www.sinririnsyo.com/limited-nike-black-womens-taylor-moton-jersey-nfl-72-carolina-panthers-2016-salute-to-service-nflw">limited nike black womens taylor moton jersey nfl 72 carolina panthers 2016 salute to service</a> <a href="http://www.walkerhut.com/nike-mercurialx-finale-s%C3%B8lv-hvid-schuheg">nike mercurialx finale s酶lv hvid</a> <a href="http://www.chrissinacori.com/herren-supra-vaider-schwarz-grau-scarpeg">herren supra vaider schwarz grau</a> <a href="http://www.coldlakeroof.com/nike-internationalist-utility-herren-schuh-engine-kurpesf">nike internationalist utility herren schuh engine</a> <a href="http://www.ericbarrak.com/free-flyknit-5.0-tr-training-schuh-key-schuheg">free flyknit 5.0 tr training schuh key</a> <a href="http://www.freemmark.com/adidas-nitrocharge-2.0-netchaussures-schuheb">adidas nitrocharge 2.0 netchaussures</a>
frozentissue http://www.frozentissue.com/
blevemusic
 blevemusic 2019-03-18 08:06回复
#254
<a href="http://www.myelectricrc.com/air-max-lunar-90-gelb-wei%C3%9F-kurpesa">air max lunar 90 gelb wei脽</a> <a href="http://www.talkofig.com/air-jordan-after-game-i-or-argent-butyg">air jordan after game i or argent</a> <a href="http://www.thedarnedclub.com/red-sox-9-ted-williams-red-new-cool-base-2018-world-series-stitched-mlb-jersey-nflw">red sox 9 ted williams red new cool base 2018 world series stitched mlb jersey</a> <a href="http://www.wintersbuy.com/dam%C3%A4nner-nike-free-tr-alle-gr%C3%BCn-butye">dam盲nner nike free tr alle gr眉n</a> <a href="http://www.charcoalsoul.com/air-jordan-true-flight-hombres-basketbtodas-zapato-key-kurpesd">air jordan true flight hombres basketbtodas zapato key</a> <a href="http://www.coberturatic.com/mennns-ralph-lauren-pony-shorts-r%C3%B8d-beige-polow">mennns ralph lauren pony shorts r酶d beige</a>
blevemusic http://www.blevemusic.com/
red under armour hat
 red under armour hat 2019-03-18 06:33回复
#253
<a href="http://www.colintilley.com/kvinders-air-jordan-retro-5-bl%C3%A5-hvid-skok">kvinders air jordan retro 5 bl氓 hvid</a> <a href="http://www.xthbgc.com/nike-air-darwin-high-bianca-rosso-scarpeh">nike air darwin high bianca rosso</a> <a href="http://www.iberishop.com/nike-roshe-nero-nero-scarpei">nike roshe nero nero</a> <a href="http://www.karmacanix.com/elite-jack-lambert-mens-jersey-pittsburgh-steelers-58-home-black-nfl-nflh">elite jack lambert mens jersey pittsburgh steelers 58 home black nfl</a> <a href="http://www.tobepartridge.com/coach-poppy-phone-wristlet-available-at-nordstrom-coachh">coach poppy phone wristlet available at nordstrom</a> <a href="http://www.shopdunks.com/adidas-neo-mesh-blu-cielo-blu-scarpeh">adidas neo mesh blu cielo blu</a>
red under armour hat http://www.clickstroy.com/red-under-armour-hat-hath
onlysidekick
 onlysidekick 2019-03-17 16:25回复
#252
<a href="http://www.cnovas.com/kvinners-nike-kyrie-1-himmelen-bl%C3%A5-gull-obuvk">kvinners nike kyrie 1 himmelen bl氓 gull</a> <a href="http://www.omnicitycorp.com/purple-coach-purse-for-sale-coachh">purple coach purse for sale</a> <a href="http://www.cmcheechalk.com/nike-kobe-icon-blu-bianca-scarpei">nike kobe icon blu bianca</a> <a href="http://www.armandopaz.com/air-jordan-retro-18-grigio-cielo-blu-scarpeh">air jordan retro 18 grigio cielo blu</a> <a href="http://www.alrightdesign.com/houston-texans-new-era-nfl-heather-pop-9fifty-snapback-cap-hath">houston texans new era nfl heather pop 9fifty snapback cap</a> <a href="http://www.parksindust.com/nike-free-run-3-violet-bleu-chaussuresh">nike free run 3 violet bleu</a>
onlysidekick http://www.onlysidekick.com/
hozloli
 hozloli 2019-03-17 14:14回复
#251
<a href="http://www.dbievents.com/adidas-neo-canvas-grau-blau-schuhek">adidas neo canvas grau blau</a> <a href="http://www.ilankocaeli.com/nike-blazer-mid-lyser%C3%B8d-skoi">nike blazer mid lyser酶d</a> <a href="http://www.msignworx.com/nike-air-max-1-em-hommes-vert-chaussuresh">nike air max 1 em hommes vert</a> <a href="http://www.dianegrams.com/tennessee-titans-baseball-cap-hatl">tennessee titans baseball cap</a> <a href="http://www.jobstodayng.com/nike-dynamo-free-ps-vert-rose-chaussuresh">nike dynamo free ps vert rose</a> <a href="http://www.hardcoreboris.com/nike-cortez-nylon-hombres-outlet-marr%C3%B3n-blanco-zapatosk">nike cortez nylon hombres outlet marr贸n blanco</a>
hozloli http://www.hozloli.com/
ayuinc
 ayuinc 2019-03-16 20:38回复
#250
<a href="http://www.profancyshop.com/air-jordan-retro-17-bl%C3%A5-guld-skok">air jordan retro 17 bl氓 guld</a> <a href="http://www.lmcgroep.com/air-jordan-melo-rosa-lilla-obuvp">air jordan melo rosa lilla</a> <a href="http://www.nowaitnails.com/mens-nike-lunarglide-6-orange-white-shoesi">mens nike lunarglide 6 orange white</a> <a href="http://www.xmrujo.com/ua-clutchfit-prodigy-gr%C3%A5-gul-skoj">ua clutchfit prodigy gr氓 gul</a> <a href="http://www.sevenguard.com/kvinners-nike-air-huarache-nm-bl%C3%A5-gull-obuvi">kvinners nike air huarache nm bl氓 gull</a> <a href="http://www.escortsue.com/mennns-nike-air-huarache-light-gul-rosa-obuvp">mennns nike air huarache light gul rosa</a>
ayuinc http://www.ayuinc.com/
coypon
 coypon 2019-03-15 19:31回复
#249
<a href="http://www.drmilliecalko.com/huarache-ultra-run-blanc-kaufen-scarped">huarache ultra run blanc kaufen</a> <a href="http://www.jishnuguha.com/herre-asics-gel-noosa-tri-8-gul-gr%C3%A5-kurpesc">herre asics gel noosa tri 8 gul gr氓</a> <a href="http://www.joehalvorson.com/nike-womens-kyle-van-noy-game-navy-blue-home-jersey-new-england-patriots-nfl-53-nflr">nike womens kyle van noy game navy blue home jersey new england patriots nfl 53</a> <a href="http://www.proximityhome.com/jordan-13-bl%C3%A5-oransje-butyg">jordan 13 bl氓 oransje</a> <a href="http://www.samexllc.com/womens-nike-philadelphia-eagles-25-tommy-mcdonald-ash-one-color-pullover-hoodie-nflz">womens nike philadelphia eagles 25 tommy mcdonald ash one color pullover hoodie</a> <a href="http://www.sandeneuhofer.com/nhl-ottawa-senators-3-way-fidget-spinner-b101-navy-nflx">nhl ottawa senators 3 way fidget spinner b101 navy</a>
coypon http://www.coypon.com/
onewebsql
 onewebsql 2019-03-15 15:01回复
#248
<a href="http://www.thenewfolk.net/air-max-1-ultra-flyknit-azul-butyd">air max 1 ultra flyknit azul</a> <a href="http://www.thepathseries.net/nike-free-run-3-5.0-hot-punch-neon-rosa-hair-obuvc">nike free run 3 5.0 hot punch neon rosa hair</a> <a href="http://www.therailers.net/boys-grade-school-nike-air-force-1-low-casual-scarpe-scarped">boys grade school nike air force 1 low casual scarpe</a> <a href="http://www.thesixwaysofatheism.net/air-jordan-14-indiglo-for-venta-queens-obuvc">air jordan 14 indiglo for venta queens</a> <a href="http://www.thesmfoundation.net/kvinners-asics-gel-noosa-tri-7-gull-bl%C3%A5-chaussuresg">kvinners asics gel noosa tri 7 gull bl氓</a> <a href="http://www.tigm.net/nike-zoom-tout-out-flyknit-noir-orange-chaussuresa">nike zoom tout out flyknit noir orange</a>
onewebsql http://www.onewebsql.net/
paradiseawards
 paradiseawards 2019-03-15 15:00回复
#247
<a href="http://www.fullscreentours.net/nike-air-max-thea-hot-rosa-yeezy-butyf">nike air max thea hot rosa yeezy</a> <a href="http://www.fultiltpoker.net/nike-free-3.0-v4-lyser%C3%B8d-gr%C3%B8n-scarpec">nike free 3.0 v4 lyser酶d gr酶n</a> <a href="http://www.gandoza.net/femmes-supra-skytop-rose-violet-chaussuresf">femmes supra skytop rose violet</a> <a href="http://www.goldspeedusa.net/kvinners-nike-free-flyknit-5.0-gull-butya">kvinners nike free flyknit 5.0 gull</a> <a href="http://www.gpscaddy.net/nike-flyknit-roshe-run-triple-negro-qasas-schuhea">nike flyknit roshe run triple negro qasas</a> <a href="http://www.grainchain.net/hommes-nike-free-6.0-or-blanc-schuhec">hommes nike free 6.0 or blanc</a>
paradiseawards http://www.paradiseawards.net/
artikhazirsin
 artikhazirsin 2019-03-15 12:12回复
#246
<a href="http://www.slimtobody.com/nike-free-run-4-herren-gr%C3%BCn-sneakerc">nike free run 4 herren gr眉n</a> <a href="http://www.lapcomit.com/mackage-leather-coat-mackager">mackage leather coat</a> <a href="http://www.eaudurable.com/chuteira-nike-mercurial-infantil-futsal-skor">chuteira nike mercurial infantil futsal</a> <a href="http://www.bambubaits.com/nike-odell-beckham-jersey-nflr">nike odell beckham jersey</a> <a href="http://www.destinyrail.com/ferragamo-white-belt-gold-buckle-beltr">ferragamo white belt gold buckle</a> <a href="http://www.brendonrush.com/womens-nike-kobe-12-orange-germany-shoeso">womens nike kobe 12 orange germany</a>
artikhazirsin http://www.artikhazirsin.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸