Hi all,
I am trying to work an an array , by storing them in a txt file so I can process it. I tried several ways for storing the key and value in a text file, but it does not work

$diff = array_diff($array1, $array2);
$myFile = "1.txt";
$fh = fopen($myFile, 'w') or die("can't open file");

//put diff array and store in 1.txt, so I can call this array again
fwrite($fh, $diff);

it only print "Array" in "1.txt", and not the key or neither the value.

I was hoping I can "call again" the array from 1.txt and do a further processing of the elements of the array that I have stored in 1.txt..

Can anyone point me any clue to solve this problem?

Sorry for my bad english, but I hope that I state the question clearly enough..

8 Years
Discussion Span
Last Post by rajarajan2017
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.