本文整理匯總了PHP中Ouzo\Utilities\Arrays::flattenKeysRecursively方法的典型用法代碼示例。如果您正苦於以下問題:PHP Arrays::flattenKeysRecursively方法的具體用法?PHP Arrays::flattenKeysRecursively怎麽用?PHP Arrays::flattenKeysRecursively使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Ouzo\Utilities\Arrays
的用法示例。
在下文中一共展示了Arrays::flattenKeysRecursively方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: hasEqualKeysRecursively
public function hasEqualKeysRecursively(array $array)
{
$currentArrayFlatten = array_keys(Arrays::flattenKeysRecursively($this->actual));
$arrayFlatten = array_keys(Arrays::flattenKeysRecursively($array));
AssertAdapter::assertSame(array_diff($currentArrayFlatten, $arrayFlatten), array_diff($arrayFlatten, $currentArrayFlatten));
return $this;
}
示例2: shouldCreateArrayWithFlattenKeys
/**
* @test
*/
public function shouldCreateArrayWithFlattenKeys()
{
//given
$array = array('customer' => array('name' => 'Name', 'phone' => '123456789'), 'other' => array('ids_map' => array('1qaz' => 'qaz', '2wsx' => 'wsx'), 'first' => array('second' => array('third' => 'some value'))));
//when
$flatten = Arrays::flattenKeysRecursively($array);
//then
$expected = array('customer.name' => 'Name', 'customer.phone' => '123456789', 'other.ids_map.1qaz' => 'qaz', 'other.ids_map.2wsx' => 'wsx', 'other.first.second.third' => 'some value');
$this->assertEquals($expected, $flatten);
}