I have two type of tags. need to replace "[" with "<". i tried with str_replace but its not working.
first Tag:
$x = '<break time="2000ms"/>';
$y = '[pause="1000ms"]';
echo str_replace(['[ pause =','[pause=','[ pause=','[pause ='],"<break time",trim($y));
second Tag:
[pitch = "x-low"][endpitch]
convert to
<prosody pitch="x-low"></prosody>
Thanks in advance.
........Updated.........
$text = '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] ?';
echo $text = preg_replace("/\[pause.*\"(\w+)\".*\]/", '<break time="$1ms"/>', $text);
output: I am [pitch = "high"]Rudratosh Shastri[endpitch]. what is your name ? how are you? sorry <break time="3000ms"/> ?
Not getting output after break time tag.