I have a list (as a string, say $ peoplelist) like this:
Name1
Name2
Name3
What I'm trying to do is split this whole line into separate elements (where each line corresponds to a new element // that is, element 1 is "name1", element 2 is "name2", etc.) and put them into an array (in essence, use line breaks as separators and separate this string into separate elements that must be placed in the array under unique indices).
This is what I have so far:
$peoplelist = file_get_contents('http://domain.tld/file-path/')
$arrayX = preg_split("/[\r\n]+/", $playerlist);
var_dump($arrayX);
Now, using the code mentioned above, this is what I get (output):
array(1) { [0]=> string(71) "Name1
Name2
Name3
" }
According to my result (from what I understand), the whole string (the list from step 1) is placed in an array under one index, which means that the second step does not do what I intend to do.
, ( ) ?
EDIT: , ! , localheinz, :)
.. - , , . .php, html - html script .