0
的陣列我有以下代碼,這需要一個字符串數組,並將其拆分爲2個字符串:concating在PHP字符串2個或多個串
$key2 = $count = count($textArray);
$key = 0;
while ($key2 >= $count/2){
$this -> text1 = $this-> text1 . $textArray[$key];
$this -> text2 = $textArray[$key2] . $this-> text2;
$key++;
$key2--;
}
眼下5索引陣列上我得到分裂它3-2,我想做2-3,所以對text1,我只會連續2字符串,
這是prolly很簡單的事情要做,但我不能。
不要使用'global'。相反,你可以寫你的匿名函數爲:'function($ x)use($ text1){$ text1。= $ x;}'。 – Yoshi
@Yoshi:謝謝! :-) ..我真的不知道'使用(..)'。 – SuperSaiyan