我有一个数组def check(status):
datafile = file('C:\Users\User\Desktop\Growth Handles.txt', 'r')
found = False
for line in datafile:
if status.user.screen_name in line:
found = True
break
return found
def on_status(self, status):
f=status.user.screen_name
if check(status) :
pass
,我需要按字母顺序对其进行排序:
$skills
我正在尝试使用
array:172 [▼
0 => Skill {#1135 ▼
-id: 1
-skill: "AngularJS"
}
.........
12 => Skill {#1184 ▼
-id: 13
-skill: "CoffeeScript"
}
但我得到
usort($skills, "cmp");
public function cmp($a, $b)
{
return strcmp($a["skill"], $b["skill"]);
}
我该如何解决这个问题?