Play a sound when a scripts load
You want to play a sound after a page loads or a script finishes execution.
Solution
Php being a processing language, it cannot play audio for the user, but it can display HTML code that will play the audio file.
You will need to embed a player in HTML like in the example:
$audio_file = "www.bogdanmduca.com/assets/sounds/sound.mp3";
echo "<audio autoplay='true' style='display:none;'>
<source src='$file_name'>
</audio>";