title: Prge_replace is not working properly in php
body: <p>I am trying to replace the below string </p>
  
  <pre><code>`$test_numbers_4 = '\\;\\3;4;5'; 
  </code></pre>
  
  <p>to </p>
  
  <p><code>3,4,5</code></p>
  
  <p>Here is my code</p>
  
  <pre><code>$test_numbers_4 = '\\;\\3;4;5';
  printf( "&lt;h4&gt;Task 4:&lt;/h4&gt;\n" ); 
  $str = preg_replace('/\s{0,}/', '', $test_numbers_4); 
  $str1 = preg_replace('/\\\\\\|;\\\\/', ',', $str); 
  $array = explode(',', $str1);
  $res=implode( ',', $array) ;
  echo $res;
  </code></pre>
  
  <p><strong>Output</strong>: <code>3,4,5</code></p>
  
  <pre><code>Edit:
  </code></pre>
  
  <p>I have a string like this <code>$string =\\,\\2,7,-3,5,-2</code>  if string is like this when i run the file i would like to show error message saying that <code>negative numbers -3,-2 not allowed.</code></p>
  
  <p>But it's not giving me the result what I expected </p>
  
  <p>Can anyone help me what is the exact problem?</p>