title: PHP preg_split Not Working
body: <p>please refer to the code below.</p>
  
  <pre><code>$dArr = '&lt;script&gt;document.write(volunteerDist);&lt;/script&gt;';
  </code></pre>
  
  <p>$dArr gets the value of volunteerDist. echo $dArr prints the value 4.1,9.4,2.3,4.7,9.1,14.7,3.2,7.1,4.1,0.5</p>
  
  <p>I wanted to split this into elements in an Array so I used:</p>
  
  <pre><code>$dArr = preg_split("/,/", $dArr);
  </code></pre>
  
  <p>But $dArr is an array with only one element, which is all of the values.. meaning no preg_split took place. I also tried</p>
  
  <pre><code>$temp=explode(",", $dArr);
  </code></pre>
  
  <p>but still did not work.</p>
  
  <p>I tried to paste the value (i.e. the numbers above) and preg_split it directly</p>
  
  <pre><code>$temp=explode(",", '4.1,9.4,2.3,4.7,9.1,14.7,3.2,7.1,4.1,0.5');
  </code></pre>
  
  <p>and it was successful. What is wrong? TAKE NOTE that when I echo $dArr, the numbers are printed.</p>