fork download
  1. <?php
  2.  
  3.  
  4. $str = 'I am [pitch = "high"]Rudratosh Shastri[endpitch]. what is your name ? how are you? sorry [pause ="3000"] i can not hear you ?[rate="-70.00%"] i still can\'t hear you[endrate] ? [rate="+50.00%"]why i can\'t hear you[endrate] ?';
  5. echo preg_replace('~\[pause[^]]*"(\d+)"]~', '<break time="$1ms"/>', $str);
  6.  
Success #stdin #stdout 0.01s 82624KB
stdin
Standard input is empty
stdout
I am  [pitch = "high"]Rudratosh Shastri[endpitch]. what is your name ? how  are you? sorry <break time="3000ms"/> i can not hear you ?[rate="-70.00%"] i still can't hear you[endrate] ? [rate="+50.00%"]why i can't hear you[endrate] ?