【发布时间】:2018-07-18 11:52:53
【问题描述】:
我有这个数组(sn-p)
array (size=631)
0 => string '11:27:35.750 INFO - Selenium build info: version: '3.4.0', revision: 'unknown'
' (length=80)
1 => string '11:27:35.751 INFO - Launching a standalone Selenium Server
' (length=60)
2 => string '2018-07-17 11:27:35.785:INFO::main: Logging initialized @534ms to org.seleniumhq.jetty9.util.log.StdErrLog
' (length=108)
3 => string '11:27:35.890 INFO - Driver class not found: com.opera.core.systems.OperaDriver
' (length=80)
4 => string '11:27:35.891 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
' (length=97)
5 => string 'Unable to create new instances on this machine.
' (length=49)
6 => string '11:27:35.891 INFO - Driver class not found: com.opera.core.systems.OperaDriver
' (length=80)
7 => string '11:27:35.891 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
' (length=90)
8 => string '11:27:35.893 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
' (length=102)
9 => string ' registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
' (length=130)
10 => string '2018-07-17 11:27:35.966:INFO:osjs.Server:main: jetty-9.4.3.v20170317
是否有一个内置函数可以按索引对该数组进行排序,使索引 pos 0 的内容为 10,反之亦然?
还是我必须自己写?
【问题讨论】:
-
查看 PHP 文档 php.net/manual/en/array.sorting.php