This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 查找数组中上一个元素键/值,下一个元素键/值 | |
* @param str $currentValue 当前元素的值 | |
* @param array $array 待查询数组 | |
* @return array 上一个元素键/值,下一个元素键/值 | |
*/ | |
public function arrayPrevNext($currentValue, $array) | |
{ | |
$prev_key = $next_key = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data[] = array('volume' => 67, 'edition' => 2); | |
$data[] = array('volume' => 86, 'edition' => 1); | |
$data[] = array('volume' => 85, 'edition' => 6); | |
$data[] = array('volume' => 98, 'edition' => 2); | |
$data[] = array('volume' => 86, 'edition' => 6); | |
$data[] = array('volume' => 67, 'edition' => 7); | |
print_r($data); | |
$column = array_column($data, 'edition'); | |
array_multisort($column, SORT_DESC, $data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
*============================ | |
* author:Farmer | |
* time:2017/12/19 | |
* blog:blog.icodef.com | |
* function:加密方式 | |
*============================ | |
*/ |
NewerOlder