Ds\Pair::toArray() 函數可以將一對轉換為數組。
用法
public array Ds\Pair::toArray( void )
Ds\Pair::toArray() 函數沒有任何參數。
Ds\Pair::toArray() 函數可以返回一個數組,其中包含與對相同順序的所有值。
示例1
<?php
$pair = new \Ds\Pair([1, 2], ["TutorialsPoint", "India"]);
echo "The array is:\n";
var_dump($pair->toArray());
?>
示例2
<?php
$pair = new \Ds\Pair("x", "TutorialsPoint");
echo "The array is:\n";
print_r($pair->toArray());
?>
相關用法
- PHP Ds\Pair toArray()用法及代碼示例
- PHP Ds\Pair copy()用法及代碼示例
- PHP Ds\Pair clear()用法及代碼示例
- PHP Ds\Pair __construct()用法及代碼示例
- PHP Ds\PriorityQueue pop()用法及代碼示例
- PHP Ds\PriorityQueue capacity()用法及代碼示例
- PHP Ds\PriorityQueue push()用法及代碼示例
- PHP Ds\PriorityQueue::clear()用法及代碼示例
- PHP Ds\PriorityQueue::peek()用法及代碼示例
- PHP Ds\PriorityQueue::pop()用法及代碼示例
- PHP Ds\PriorityQueue copy()用法及代碼示例
- PHP Ds\PriorityQueue count()用法及代碼示例
- PHP Ds\PriorityQueue toArray()用法及代碼示例
- PHP Ds\PriorityQueue clear()用法及代碼示例
- PHP Ds\PriorityQueue allocate()用法及代碼示例
注:本文由純淨天空篩選整理自 PHP - Ds\Pair::toArray() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。