title: PHP : Split a comma delimited & special symbol string into an array
body: <p>I already seen how to split a comma delimited string into an array in PHP using </p>
  
  <pre><code>$myArray = explode(',', $myString);
  </code></pre>
  
  <p>but how to perform the same operation when there is an special symbol after some comma separated values, when finding the special symbol(@), then start a new inner array.</p>
  
  <p>i have a string like this</p>
  
  <pre><code>Treatment1,2,500,0%,1000,note1, @ Treatment2,1,2000,250 INR,1750,note2,
  </code></pre>
  
  <p>then i need an array like this</p>
  
  <pre><code>Array
  (
  
          [0] =&gt; Array
              (
                  [treatment] =&gt; Treatment1
                  [quantity] =&gt; 2
                  [cost] =&gt; 500
                  [discount] =&gt; 0%
                  [discount_type] =&gt; INR
                  [total] =&gt; 1000
                  [note] =&gt; note1 
              )
  
          [1] =&gt; Array
              (
                  [treatment] =&gt; Treatment2
                  [quantity] =&gt; 1
                  [cost] =&gt; 2000
                  [discount] =&gt; 250
                  [discount_type] =&gt; INR
                  [total] =&gt; 1750
                  [note] =&gt; note2 
              )
  )
  </code></pre>
  
  <p>any help would be greatly appreciated</p>