title: Encode string to match encoded form field name in PHP POST array
body: <p>The name of my HTML checkbox form field is something like this:</p>
  
  <pre><code>name = "Some File name.pdf"
  </code></pre>
  
  <p>The PHP POST array looks something like this (some characters replaced by underscore):</p>
  
  <pre><code>array(
   "Some_File_name_pdf" =&gt; "on"
  )
  </code></pre>
  
  <p>Is there a PHP function I can use to convert a filename string exactly as it appears in the POST array? I am not interested in str_replace.
  I want to be able to do this:</p>
  
  <pre><code>$myfilename = $obj-&gt;getFileName(); // returns "Some File name.pdf"
  $result = isset($_POST[some_encoding_function($myfilename)]);
  </code></pre>
  
  <p>The some_encoding_function should take a string like "Some File name.pdf" and return something like "Some_File_name_pdf";</p>