亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

函數的結果怎么賦值給變量啊

函數的結果怎么賦值給變量啊

PHP
幕布斯6054654 2019-03-12 14:23:19
<?php $name = 'stefen'; $tel = '10795856'; $motto = 'If you shed tears when you miss the sun,then you would miss the stars'; function totalLen(...$string){ //=print_r($string); foreach ($string as $content) { echo strlen($content).','; } } $arrNum = totalLen($name,$tel,$motto); //totalLen($name,$tel,$motto)會得到6,8,69,但是貌似不能賦值給$arrNum echo array_sum(array($arrNum)); 我想實現的功能是,無論有多少變量傳入函數,都能自動計算出所有字符的長度的和,但是現在沒辦法把得到的結果賦值給變量,求指教
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 725 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號