Okay so I have a txt file.
I turn the data of the txt file into an array.
$lines = file($filename);
Then send the data back to the client ($filename is determined through ajax)
print_r( array_values( $lines ));
I retrieve the data from ajax
success: function(docinfo){
alert(docinfo);
}
And I get something like this:
Array
(
[0] => 10
[1] => 123
[2] => 455
[3] => 325
[4] => 33
[5] => 3
)
but when I want to access the values of the array
console.log(docinfo[0]);//which represents the first line of my txt file
I get "A" which is the first letter of "Array". not the value of docinfo[0] which I want.
Is there a way where I can send the array and retrieve the values so I can use them the way I want?