gpt4 book ai didi

php - 如何让 "th "只出现一次

转载 作者:行者123 更新时间:2023-11-29 22:54:23 26 4
gpt4 key购买 nike

修改:

我的contractEmail.php中有这些:

if(isset($_POST['submit']) && $_POST['submit'] == 'Send') {

$size= sizeof($_POST['users']);
$i = 0;


$message = NULL;

// $message = null;
for($i=0; $i<$size; $i++){


$userId = $_REQUEST['users'][$i];

$message .= mailContent($userId);


}

$to = $_POST['email'];
$subject = 'This is a test';
$headers = 'From: xx@live.com.ph' . "\r\n" .
'Reply-To: xx@live.com.ph' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/html; charset=ISO-8859-1\r\n';


mail($to, $subject, $message, $headers);
}

function mailContent($userId) {


$con=mysqli_connect("localhost","xx","xx","xx");
$stmt = "SELECT * from CV where idvisa = '$userId'";
$result = mysqli_query($con, $stmt);

$row=mysqli_fetch_array($result);

$fName = $row['fName'];
$lName = $row['lName'];
$visaNumber = $row['visanumber'];
$idNumber = $row['idnumber'];
$statusApp = $row['statusapp'];
$accntVisaPhotoPath = $row['accntVisaPhotoPath'];
$passportPath = $row['passportPath'];
$subdate = $row['subdate'];

$message = "<table>
<tr>
<th>Name</th><th>Visa Number</th><th>ID Number</th><th>Application Status</th><th>Visa Copy</th><th>Passport Copy</th><th>Date</th>
</tr>" . "\r\n";
$message .= "<tr>
<td>$fName $lName</td><td>$visaNumber</td><td>$idNumber</td><td>$statusApp</td><td>$accntVisaPhotoPath</td><td>$passportPath</td><td>$subdate</td>
</tr>
</table>" . "\r\n";
// OTHER LOGICS GO HERE

return $message;

}
echo "<center>You have sent CV(s) </b><br/><br/><br/><br/>YOU MAY NOW CLOSE THIS WINDOW</center>";
?>

但问题是,事情并不如预期。 th 在电子邮件中重复到第 10 个。如何让 th 只出现一次?

这就是我想要的:

|  Name   |   Visa Number   | ID Number   |
| Jurie | 09254352654 | 5674356747 |
| Alex | 56756786797 | 5464654545 |

这是我的 link

最佳答案

您在 11(表行)中使用相同的变量。这就是在电子邮件中重复最多 10 次的原因。

关于php - 如何让 "th "只出现一次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28781801/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com