0
$allProfiles = '';
foreach(array_merge($profile, $otherProfiles) as $all):
$allProfiles .= $all;
endforeach;
echo "Player all profiles: $allProfiles";
這爲我打印Player all profiles: NameNameNameNameName
,我該如何通過逗號內插?當我製作$allProfiles .= implode(",", $all)
;然後我得到了提前Invalid arguments passed in
感謝PHP字符串implode:傳入的參數無效
編輯
只是改變$allProfiles .= $all;
到$allProfiles[] = $all;
則回波使用implode
..
你可以做'$ allPrfiles [] = $ all;'在循環中,然後在底部implode:'echo「播放器所有配置文件:」.implode(',' ,$ allProfiles);'將'$ allPrfiles'設置爲頂部的數組,而不是空的。 – Rasclatt
@Rasclatt是的..現在注意到了,謝謝;) – EvaldasL