2 回答

TA貢獻1827條經(jīng)驗 獲得超8個贊
alert(" hi \r\n i am at new line")
<br/>代碼中第二次出現(xiàn)的被替換為“/r” 嘗試
<?php
function alert($msg)
{
$msg = "'$msg'"; //to get message enclosed by single quotes
echo "<script type='text/javascript'>", //try other approach
"alert($msg);",
"</script>";
}
$arr = array("btnRegisterAdmins"=>1);
if(array_key_exists('btnRegisterAdmins', $arr))
{
$fname = ""; //guessing no fname
$lname=""; //guessing no lname
$alertscript ="";
if(empty($fname))
{
$alertscript = " you need...";
}
if(empty($lname))
{
$alertscript = $alertscript . '\r to be good...';
alert($alertscript);
}
}
?>
- 2 回答
- 0 關(guān)注
- 123 瀏覽
添加回答
舉報