How to show javascript alert using PHP?

We can easily show javascript alert box using php code.

Find the code below :

<?php 
echo ("<SCRIPT LANGUAGE='JavaScript'>
	window.alert('Successfully Saved')
        window.location.href='index.php'
    </SCRIPT>");
?>