After expolde send that data to given mail in php

Here is an example of how you can send data to a given email address using PHP after exploding a string:

<?php

// assume $data is the string you want to explode
$data = "hello,world,foo,bar";

// explode the string into an array
$data_array = explode(",", $data);

// assume $to_email is the email address you want to send the data to
$to_email = "[email protected]";

// create a new PHPMailer object
$mail = new PHPMailer\PHPMailer\PHPMailer();

// set the email address
$mail->setFrom("[email protected]", "Your Name");

// set the recipient email address
$mail->addAddress($to_email);

// set the subject
$mail->Subject = "Data Sent from PHP";

// set the body of the email
$mail->Body = "";

// loop through the array and add each value to the body of the email
foreach ($data_array as $value) {
    $mail->Body.= $value. "\n";
}

// send the email
$mail->send();

?>

This code uses the PHPMailer library to send an email with the exploded data as the body of the email. You'll need to install PHPMailer and configure it to use your email server.

Alternatively, you can use the built-in mail() function in PHP to send the email, like this:

<?php

// assume $data is the string you want to explode
$data = "hello,world,foo,bar";

// explode the string into an array
$data_array = explode(",", $data);

// assume $to_email is the email address you want to send the data to
$to_email = "[email protected]";

// create the email body
$email_body = "";

// loop through the array and add each value to the body of the email
foreach ($data_array as $value) {
    $email_body.= $value. "\n";
}

// send the email using the mail() function
mail($to_email, "Data Sent from PHP", $email_body);

?>

This code is simpler, but it may not be as robust or flexible as using a dedicated email library like PHPMailer.