语法错误,意外T_ELSE,期待'}' [英] Syntax error, unexpected T_ELSE, expecting '}'

查看:150
本文介绍了语法错误,意外T_ELSE,期待'}'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我修复收到的错误信息。它说错误是第9行。这是代码。



Please help me fix this error message I have received. It says the error is with line 9. Here's the code.

<?php

$contacts = array("entered_email_adress@yourdomain.com", "Zoho_CRM@yourdomain.com", "Mail_Chimp@yourdomain.com");

foreach($contacts as $contact) 
{
	$to = $contact;

	else if($contact == "entered_email_adress@yourdomain.com")
	{
		$subject = 'Web Form Inquiry';
		$subject = 'the subject';
	}
	else if($contact == "Zoho_CRM@yourdomain.com")
	{
		$subject = 'the subject';
		$message = "First Name" + ", " + "Last Name", + " + " "Company", + ", " + "Email"
	}
	else if($contact == "Mail_Chimp@yourdomain.com")
	{
		$subject = 'the subject';
		$message = "First Name" + ", " + "Last Name"
	}

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

?>





我的尝试:



自收到错误消息以来,我一直在寻找解决方案。



What I have tried:

I've been searching for a solution ever since I received the error message.

推荐答案

contacts = array(entered_email_adress@yourdomain.com,Zoho_CRM@yourdomain.com,Mail_Chimp@yourdomain.com);

foreach(
contacts = array("entered_email_adress@yourdomain.com", "Zoho_CRM@yourdomain.com", "Mail_Chimp@yourdomain.com"); foreach(


联系人


联系人)
{
contact) {


这篇关于语法错误,意外T_ELSE,期待'}'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆