fork download
  1. <?php
  2.  
  3. $var = "a - it is a string"; // I want this output: 'it is a string'
  4. $var2 = "m - it is second string";
  5.  
  6.  
  7. echo preg_replace('/^.\s-\s/im', '', $var)."\n";
  8. echo preg_replace('/^.\s-\s/im', '', $var2);
Success #stdin #stdout 0.02s 52480KB
stdin
Standard input is empty
stdout
it is a string
it is second string