I know that there are many resources for placing CSV in an associative array, but I can not find anything that helps a noob, like me, to do exactly what I want to do.
I currently have an associative array defined inside my PHP file:
$users = array(
'v4f25' => 'Stan Parker',
'ntl35' => 'John Smith',
);
I would like to move this array to a CSV file (users.txt) so that:
v4f25, Stan Parker
ntl35, John Smith
The next step is to import user.txt so that I can use it just like I used the $ users array.
Any help here? The last code I tried returned this: (this is not what I want)
array(2) {
["v4f25"]=>
string(5) "ntl35"
["Stan Parker"]=>
string(10) "John Smith"
}
source
share