Here's my code in side of my php file:
echo '<script type="text/javascript">';
echo '<audio id="player" src="../cdh/ba1.mp3"></audio>';
echo '<a onclick="document.getElementById('player').play()"><i class='fa fa-lg fa-volume-up'>';
echo '</script>';
I was basing this off of Ionuț G. Stan's answer on How to output JavaScript with PHP and Sykox's answer on Single icon sound player in html using font awesome. I just took out the div
s changed the src
& i class
.
The line giving me issues has got to be:
echo '<a onclick="document.getElementById('player').play()"><i class='fa fa-lg fa-volume-up'>';
which gives the error:
Parse error: parse error, expecting
','' or
';''
What am I doing wrong?!