title: PHP array modification
body: <p>I have a file containing a two dimensional array and the first term of each nested array is of form id=>2. </p>
  
  <p>I want to extract the array into another file, find the last id in the array, add one to it, create a new array element containing that new id term, add it to the array and then save the edited array back to the original file. </p>
  
  <p>This seemingly simple task has got me beat. I can do the whole thing as long as the processing is done within the original file and I can use file_get_contents() to get the contents of one file into another. But then if I try to use any of the contents I've extracted, eg the array name, php tells me it is undefined.</p>
  
  <p>Grateful if someone could give me a pointer on how to do this.</p>