第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

php中的函數(shù)可選屬性

php中的函數(shù)可選屬性

PHP
翻翻過去那場雪 2022-07-29 10:43:18
我有一個(gè)由 2 個(gè)可選屬性組成的功能,以及如何發(fā)送值高?function test($size=1,$hight=2){// code .........} test($hight) test(null,$hight);還有其他方法嗎?我不需要測試(null,$ hight);
查看完整描述

2 回答

?
倚天杖

TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超3個(gè)贊

你可以使用它,也許它會對你有所幫助。


function test($hight=null,$size=null){

 // code .........

}

$hight = 2;

$size = 1;

test($hight)

test($hight,''); // if you pass as '' - blank even it's work and if second parameter is not given even it will work.



查看完整回答
反對 回復(fù) 2022-07-29
?
梵蒂岡之花

TA貢獻(xiàn)1900條經(jīng)驗(yàn) 獲得超5個(gè)贊

您可以嘗試將功能更改為這樣的東西嗎?


function test() {

      $args = func_get_args();


      /** now you can access these as $args[0], $args[1] **/

 }


查看完整回答
反對 回復(fù) 2022-07-29
  • 2 回答
  • 0 關(guān)注
  • 136 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號