Skip to content

Instantly share code, notes, and snippets.

View haxianhe's full-sized avatar
🦍
Hello !

haxianhe haxianhe

🦍
Hello !
View GitHub Profile
@haxianhe
haxianhe / find_key_value.php
Created July 25, 2018 12:46
查找数组中上一个元素键/值,下一个元素键/值
<?php
/*
* 查找数组中上一个元素键/值,下一个元素键/值
* @param str $currentValue 当前元素的值
* @param array $array 待查询数组
* @return array 上一个元素键/值,下一个元素键/值
*/
public function arrayPrevNext($currentValue, $array)
{
$prev_key = $next_key = null;
@haxianhe
haxianhe / sort.php
Last active January 7, 2020 07:37
PHP 对数据库结果排序(对多维数组排序)
<?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);
@haxianhe
haxianhe / aes_ecb_pkcs5.php
Created July 24, 2018 11:58 — forked from CodFrm/aes_ecb_pkcs5.php
PHP对接java的AES/ECB/PKCS5Padding加密方式
<?php
/**
*============================
* author:Farmer
* time:2017/12/19
* blog:blog.icodef.com
* function:加密方式
*============================
*/