I'm having trouble with this code. If the field customer_note
is empty, need it to return a value of N
and Y
if there is text in the field. The resulting Y
or N
is being passed into an XML line. I'm using PHP 5.2.9.
Thank you.
if( !empty( $customer_note )) {
$shopper_message .= $customer_note."\n";
} else {
$shopper_message .= "\n";
}
I'm not sure if you want this:
< ?php
function check_ifempty($customer_note)
{
if (empty($customer_note))
{
return "N";
}
else
{
return "Y";
}
}
?>
< ?php
$customer_note = $_POST["customer_note"];
$result = check_ifempty($customer_note);
$xml .= $result;
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.