how to get the javascript alert value in php variable on functions.php code example
Example 1: alert a php variable
echo '<script type="text/javascript">alert("'.$error.'");</script>';
Example 2: alert js in php
javascript:alert('Email enviado com Sucesso!');
javascript:window.location='index.php';