Sorting php data var

后端 未结 2 1601
逝去的感伤
逝去的感伤 2021-01-29 01:17

UPDATE: Ok, thanks everyone. But, when I replace var with $ i now get these errors:

array_multisort()[function.array-multiso

相关标签:
2条回答
  • 2021-01-29 01:35
    var mostPoints = max($points);
    

    Have you been using JavaScript a lot lately (or old PHP 4 OO)?

    PHP's only use of the var keyword was for old PHP4 style object property definitons.

    Drop the var part.

    Also, don't forget the PHP variable sigil $.

    0 讨论(0)
  • 2021-01-29 01:43

    yup, you need $mostPoints, not var mostPoints

    0 讨论(0)
提交回复
热议问题