C
C
crack_user2021-06-21 17:02:03
PHP
crack_user, 2021-06-21 17:02:03

Is it possible to add 3+ responses to a variable?

Sorry if I didn't phrase the question well.
Is it possible to add a third answer here? Tried different options, didn't work.

$type_ca = ($info['type']==1) ? 'open' : 'close';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-06-21
@crack_user

$types = ['close', 'open', 'unknown', 'something_else'];
$type_ca = $types[$info['type']];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question