I have a list of products codes that i wish to read into an array using php.
the list is to be fetched from a website and has over 700 items looks something like this:
4310ABC
4590DEF
8950GHK
What i want to do is put every code into a php array like so:
php_array ( [0] => 4310ABC
[1] => 4590DEF
[2] => 8950GHK)
This is what i have:
$php_array = file_get_contents('http://anysite.net/product_codes.php');
print_r (explode("
",$php_array));
But my result is :
Array ( [0] => 4310ABC
4590DEF
8950GHK)
I have tried explode, preg_split('/[ ]+/', $php_array); but nothing seems to do the trick. Can anyone give me some pointers? thanks!