change date format from yyyy/mm/dd to dd/mm/yyyy

(Attention: Green PHP newbie !)
I have an online inquiry form, delivering a date in the form yyyy/mm/dd to my feedback form. If the content passes several checks, the form sends an e-mail to me. All works fine. I just would like to receive the date in the form dd/mm/yyyy. I tried with some code, copied from a forum, but it resolves in a parse error. To make clear what I mean, I better insert the code, which is stripped down to 2 fields ('data_start' and 'data_end'). Can anyone please advise how to do and where to insert such a date conversion in this code below ?
Thanks a lot !

Here is the code: (my modification from line 39 to 47)

<?php 
session_start(); 
// ------------- CONFIGURABLE SECTION ------------------------
$mailto = 'xxx@xxx' ;
$subject = "Inquiry Form" ;
$formurl = "the contact.php form" ;
$errorurl = "the error message .htm" ;
$thankyouurl = "the thank-you message .htm" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
// load the variables form address bar
$data_start = $_POST['data_start'] ;
$data_end = $_POST['data_end'] ;
// etc.
// remove the backslashes that normally appears when entering " or '
$data_start = stripslashes($data_start);
$data_end = stripslashes($data_end);
// etc.
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
 header("Location: $formurl" );
 exit ;
}
// all fields are empty : arrival, departure, pax and comments ==> error
if(empty($data_start) && empty($data_end) && empty($pax)&& empty($comment)){ 
exit("You have not specified any booking details"); 
exit;
} 
$arrive = explode($_POST['$data_start'],"/");
$arrive[0] =yyyy
$arrive[1] =mm
$arrive[2] =dd
// swap round
$data_start = sprintf("%s/%s/%s",$arrive[2],$arrive[1],$arrive[0]);
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
 header("Location: $errorurl" );
 exit ;
}
if (!isset($_POST['email'])) {
 header("Location: $formurl" );
 exit ;
}
$messageproper =
 "This message was sent from:\n" .
 "$http_referrer\n\n" .
 "------------------------- COMMENTS -------------------------\n\n" .
 "Date of Arrival:  " .  
 "$data_start\n" . 
 "Date of Departure:  " . 
 "$data_end\n" .  
 "\n\n---------------- END OF MESSAGE -----------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04" );
header( "Location: $thankyouurl" );
 // delete the cookie so it cannot sent again by refreshing this page
 setcookie('tntcon','');  
 exit;
 
 // if verification code was incorrect then return to contact page and show error
 header("location:contact.php?Title=$Title&name=$name&email=$email&phone=$phone&fax=$fax&nationality=$nationality&data_start=$data_start&data_end=$data_end&result=$result&pax=$pax&children=$children&payment=$payment&appick=$appick&purpose=$purpose&comment=$comment&wrong_code=true");
exit;
} else {
 echo "You entered a wrong verification code. Please go back and try again.";
 exit ;
}
?>

maybe try:

...
} 
$arrive = explode($_POST['$data_start'],"/");
$arrive[2] =yyyy
$arrive[1] =mm
$arrive[0] =dd
// swap round
$data_start = sprintf("%s/%s/%s",$arrive[2],$arrive[1],$arrive[0]);
}
...

@ gc_sw :slight_smile: Thanks for the hint, but you changed only the sequence, right ?

Looking at the code in your post below, which you gave me, you'll see:
$arrive[1] =mm

in black, whereas 0 and 2 are in red !
And so does my phpDesigner 7. It comes up with "syntax error unexpected T_Variable" at that line, which is line 42 in my code.
I can't see what's wrong with that line. Can you ?

i have not changed the sequence. i have assigned inverse order.

...
} 
$arrive = explode($_POST['$data_start'],"/");
$arrive[0] =dd
$arrive[1] =mm
$arrive[2] =yyyy
// swap round
$data_start = sprintf("%s/%s/%s",$arrive[2],$arrive[1],$arrive[0]);
}
...

OK, if I had put it wrong - that's due to my English -sorry, not my native language. But phpDesigner still comes up with the same error. (the screenshot is attached). Do you have any idea why ?

sh... where is that jpg now, which I attached and uploaded ? I tried again to upload, but it says: "You have already attached this file in thread..."

---------- Post updated at 11:05 PM ---------- Previous update was at 10:57 PM ----------

I renamed the jpeg and tried again to upload --> same message "You have already attached this file in thread " ! ?? Anyway...

your picture is here:

well but i'm not sure what error it is.