In your feedback form, you are testing the domain name from the customer\'s emai
ID: 3872727 • Letter: I
Question
In your feedback form, you are testing the domain name from the customer's email address to send feedback to the appropriate person. Write code to set the $toaddress variable to bob@example.com if the domain name from the customer’s email address is “bigcustomer.com”, otherwise set $toaddress to feedback@example.com. (Assume: all variables are defined previously.)
$email_array = Blank 1('@', $email);
if (Blank 2(Blank 3) == "bigcustomer.com") {
$toaddress = Blank 4;}
else {
$toaddress = Blank 5;
}
Explanation / Answer
Hi Let me know if you need more information:-
=====================================
ECHO has given for your understanding
=================================
Blank 1 : explode
Blank 2: $email_array
Blank 3: [1]
Blank 4: "bob@example.com"
Blank 5: "feedback@example.com"
========================
<?php
$email = "ABC@bigcustomer.com";
$email_array = explode('@', $email);
if ($email_array[1] == "bigcustomer.com") {
$toaddress = "bob@example.com";
}
else {
$toaddress = "feedback@example.com";
}
echo "toaddress: $toaddress"
?>
======================
OUPUT:-
toaddress: bob@example.com
=========================
toaddress: bob@example.com
=============================
Thanks