I'm looking at some HTML that has embedded audio-playback links like that:
...<input type="button" onclick="return play('filename', 'title');" class="playlink" />...
I'm trying to programmatically replace that with tokens in this format:
{a:filename:title}
But something's not working right. Could someone look at it:
<?php
$src = 'aaaaa<input type="button" onclick="return play(\'hellofile\', \'hellotitle\');" class="playlink" />bbbbb';
$t = preg_replace('#<input\ type="button"\ onclick="return play(\'(.*?)\',\ \'(.*?)\');"\ class="playlink"\ />#us', '{a:${1}:${2}}', $src);
echo $t;
?>