排序数组并将其输入到php中的另一个数组中

时间:2015-04-29 14:30:14

标签: php arrays

这是打印时数组的结果:

print_r($frequency);

结果:

Array
(
    [A] => 1
    [very] => 1
    [nice] => 2
    [to] => 3
    [tot] => 1
    [text] => 2
    [Something] => 1
    [think] => 1
    [about] => 1
    [if] => 1
    [you're] => 1
    [into] => 1
)

我想按数字排序,然后输入单词到另一个数组。 我想要这样的数组:

newArray(to,nice,text,a,very,tot,something,think,about,if,your're,into)

2 个答案:

答案 0 :(得分:0)

asort($frequency);

按照从低到高的值对数组进行排序并保持分离。

我不知道ne数组的部分,因为我不明白你想要做什么。

答案 1 :(得分:0)

std::string