title: Hashing an entire PHP array into a unique value
body: <p>Looking for a way to produce a filename-safe hash of a given PHP array.  I'm currently doing:</p>
  
  <pre><code>$filename = md5(print_r($someArray, true));
  </code></pre>
  
  <p>... but it feels "hacky" using print_r() to generate a string unique to each array.</p>
  
  <p>Any bright ideas for a cleaner way to do this?</p>
  
  <p><strong>EDIT</strong>
  Well, seems everyone thinks serialize is better suited to the task.  Any reason why?  I'm not worried about ever retrieving information about the variable after it's hashed (which is good, since it's a one-way hash!). Thanks for the replies!</p>