-1
我有這個功能在我的類追加A然後B到每個數字
public function createPeriods($numPeriods){
$numPeriods = ($numPeriods*2);
}
numPeriods將總是等於5或6。 我需要每個週期分爲兩半,並附加字母A到上半場,B到下半場。我期望的結果應該是這樣的,如果有5
periods($numPeriods = '5';):
"1A,1B,2A,2B,3A,3B,4A,4B,5A,5B"
看看'模數' –
您的標題沒有描述你想要什麼。您將'A'和'B'附加到所有數字。 – Barmar
除非我錯過了關於我的標題的東西,這正是我所需要的。將字母A附加到偶數,將字母B附加到奇數。不知道如何才能誠實地問問題 – RIsoldier