0

私はphp 4.4.9を使用しています。

コードは次のとおりです。

$ipgenARRAY = explode('0',$ipgenPLAY); // every character will be an array value
$ipgenARRAYPLAY = array_shift($ipgenARRAY); // Chop off a character (0)
array_push($ipgenARRAYPLAY,"1"); // Add a one [first warning here]
$ipgenARRAY = $ipgenARRAYPLAY; // Save ^ change for the next time the loop is run
$ipgenARTEMP = implode(",",$ipgenARRAYPLAY); // Make the array into a string 
// with every array value split by a comma [second warning above]
$ipgenPLAY = str_replace(',','',$ipgenARTEMP); // remove all the commas

ここにエラーがあります

Warning: array_push() [function.array-push]: First argument should be an array
Warning: implode() [function.implode]: Bad arguments

何らかの理由で、配列が配列として受け入れられない

4

1 に答える 1

8

array_shiftは配列を返さず、渡された配列の最初の値を返します。渡された配列は変更されます。

于 2013-06-24T01:57:45.403 に答える