我是小白所以请耐心等待 我一定要考一个数组,让我检查它是否存在,并查看是否在它的数字都OK。 在任何情况下,都必须发出一条消息......例如...如果数组已满并且数字正常,我应该得到一条消息,如(数组已满,Num都可以)。但是,如果我以后遇到麻烦,因为......好吧,请自己看看。麻烦与if语句
public static function getTest($ids){
$input_result = array();
foreach ($ids as $id) {
$input_result['result']['Id '.$id] = $id;
}
if((!empty($ids))){
//echo "You have inputted some data in the Api_Books_Book::getTest<br/>";
$input_success = "Successful!";
$input_message = "Array OK";
}
else
{
//echo "There is no data<br/>";
$input_success = "Not Successful";
$input_message = "Have inputed anything in the array?";
}
if(okNum($ids)) {
//echo "You have inputted some data in the Api_Books_Book::getTest<br/>";
$input_success = "Successful!";
$input_message = "numbers OK";
}
else {
//echo "There is no data<br/>";
$input_success = "Not Successful";
$input_message = "numbers not OK";
}
$result=array('status'=>$input_success,'message'=>$input_message,'result'=> $input_result);
rdie($result);
return $result;
}
感谢您对负...你至少说明我做错了什么? –
使用上面的代码得到的错误/意外结果是什么? (不是我-1) –
的事情是,当我离开的阵列空...它仍然给我,万物确定...“全成”同时,该数字是行...我想消息得到消息...你有没有把东西放在数组中。 –