本文整理汇总了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);
}