PHP itself can't interact with the client. You will have to have the PHP script output a JavaScript solution.
echo '<script type="text/javascript">';
if ($a==1) {
echo "alert('Good value!');";
}else{
echo "alert('Wrong value!');";
}
echo '</script>';