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 回答