Reputation: 637
so I have created a Shell command that is executed using PHP, and it returns something like this:
deathletsgo
lordhaigh
pampos
cheese510
TheLoneRanger6
And I've been trying to find a way to loop through and put each name in a different value in an array, so like Servers[0]
would contain deathletsgo and Servers[1]
would contain lordhaigh, etc, any ideas?
Thanks!
Upvotes: 1
Views: 329
Reputation: 219874
$string = "deathletsgo
lordhaigh
pampos
cheese510
TheLoneRanger6";
$servers = explode("\n", $string);
Upvotes: 3