Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我创建了一个使用 PHP 执行的 Shell 命令,它返回如下内容:
deathletsgo lordhaigh pampos cheese510 TheLoneRanger6
而且我一直在尝试找到一种方法来循环遍历并将每个名称放在一个数组中的不同值中,所以喜欢Servers[0]包含 deadletsgo 并Servers[1]包含 lordhaigh 等,有什么想法吗?
Servers[0]
Servers[1]
谢谢!
$string = "deathletsgo lordhaigh pampos cheese510 TheLoneRanger6"; $servers = explode("\n", $string);