S
S
Sergey Miller2020-04-19 15:06:57
PHP
Sergey Miller, 2020-04-19 15:06:57

How to send bare text if empty (php)?

if(empty($getdata[$name]['value'])) {
                     unset($getdata[$name]);
                  }


There is a piece of code that says - "if the field in the form is not filled, then cancel the transfer of its data." How to write in php instead of unset($getdata[$name]); so that the text "not filled" was stupid ?
Tried echo "..."; and print "...."; does not fuss, nothing comes from this field in the letter at all. What's the matter huh

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Miller, 2020-04-19
@blackseabreathe

I finished it myself (I don’t know how crooked it is, but it seems to be nothing like this):

if(empty($getdata[$name]['value'])) {
$emptyField = 'не заполнено';
$getdata[$name]['value'] = htmlspecialchars($emptyField);
}

Z
Zikrillo Abbosov, 2020-04-19
@azymson

Seems

if($getdata[$name]['value']<>''){
echo "Не заполнено";
}

A
Anton R., 2020-04-19
@anton_reut

if(empty($getdata[$name]['value'])) {
unset($getdata[$name]);
echo 'не заполнено';
}

if(empty($getdata[$name]['value'])) {
unset($getdata[$name]);
$message = 'не заполнено';
return $message;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question