Good evening, At the processor 2 forms, the processor sends 2 messages to the email. But these 2 messages are needed only when sending from one form in which the phone is filled. accordingly, sending 2 messages is as follows:

$sendsms = mail ($tosms, $subjectsms, $messagesms, $headerssms); $send = mail ($to, $subject, $message, $headers); 

In the $messagesms array, there is $uphone How can $uphone remove or prohibit the execution of $sendsms if there is no information in $sendsms ?

  • one
    Check if (isset($messagesms[...])) $sendsms = ... - Anton Shchyrov
  • @Anton Shchyrov if (isset($message['uphone'])) { $sendsms = NULL; } if (isset($message['uphone'])) { $sendsms = NULL; } does not help determine the value of $uphone from $message = "$uname $uemail $uphone"; - FunnyPHP
  • You did not ask how to determine the value. You asked how to disable sending if there is no value in the array - Anton Shchyrov
  • @Anton Shchyrov the bottom line is that $ uphone is always present in $ message, only it is either with a value or not, that is, I need to find the value in the array by isset further if the value is different, it is NULL or perform the function, right? - FunnyPHP
  • With hands, if you remove $ uphone from an array anyway does not work, null value is not substituted in $ sendsms - FunnyPHP

0