title: parse delimited string into associative array
body: <p>I'm just optimising my code and if there is a function that does something like this, i can get rid of my own</p>
  
  <p>There are duplicates for parsing query strings but the string I'm paring is in this format:</p>
  
  <pre><code>$string = "cheese/camel/egg/cream";
  </code></pre>
  
  <p>is there a php function whereby I can parse this into an associative array?</p>
  
  <p>Lets say if I were to define the array with keys like:</p>
  
  <pre><code>$keys = array( "val1", "val2", "val3", "val4" );
  </code></pre>
  
  <p>is there a php function to parse the string into these variables? Something like:</p>
  
  <pre><code>$associative_array = magic_function($keys, $string, $delimiter);
  </code></pre>
  
  <p>to end up with something like this:</p>
  
  <pre><code>array(4) {
        "var1" =&gt; "cheese",
        "var2" =&gt; "camel",
        "var3" =&gt; "egg",
        "var4" =&gt; "cream"
  }
  </code></pre>