PHP Ds Deque find() 函数 Ds\Deque::find() 函数可以尝试查找值的索引。 语法 public mixed Ds\Deque::find( mixed $value )PHPCopy Ds\Deque::find()函数可以返回一个值的索引,如果未找到则返回false。 示例1 <?php deque = new \Ds\Deque([10, 20, 5, 40, 50, 8]); echo("The elements in the deque: \n"); print_r(deque); print_r($deque->find(3)); ?>PHPCopy 示例2 <?php deque = new \Ds\Deque(["Tutorials", "Point", "India"]); echo("The elements in the deque: \n"); print_r(deque); var_dump($deck->find("TPT")); ?>PHPCopy