Skip to content

Instantly share code, notes, and snippets.

domainbank lovecn

Block or report user

Report or block lovecn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lovecn
lovecn / arr_sort.php
Created Sep 2, 2014
对二维数组按一维数组指定顺序排序
View arr_sort.php
$mysort = new mysort;
$mysort->ceshi();
class mysort{
public function ceshi()
{
$arr1 = array(
array('id' => 1, 'name' => 'yhp'),
array('id' => 2, 'name' => 'yhp2'),
array('id' => 3, 'name' => 'yhp3'),
View index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@lovecn
lovecn / sort.js
Last active Aug 29, 2015
对二维数组求平均值排序
View sort.js
Array.prototype.sum=function(){
var num=0;
for(var i=0;i<this.length;i++){
num+=this[i];
}
return num;
}
function vhall_sort(arr){
You can’t perform that action at this time.