コード内の質問;
<?php
/*
* @array
*/
$input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank");
$rand_keys = array_rand($input, 2); //What does the two mean?
echo $input[$rand_keys[1]] . "\n"; //What does the 1 stand for? and Why do I have to define $input again if it was defined in $rand_keys?
?>
数字はどういう意味ですか?ありがとう。
編集:
私が試してみました:
$input = array("test", "test2", "test3", "test4");
$rand_keys = array_rand($input, 2);
$echo = $input[$rand_keys[0]];
echo $echo;
そしてそれはtest3に現れます。私は配列ランドで2つしか実行しませんでした。なぜ3を表示しているのですか?