I
I
Ivan Wagner2019-01-31 15:20:46
JSON
Ivan Wagner, 2019-01-31 15:20:46

How to add new condition, array?

Hello! There are avatars on a crutch:

'bigAva' => ($users['sex'] == m ? 'https://test.aquaworldonline.ru/img/avatars/full/m.png' : 'https://aquaworldonline.ru/img/avatars/full/f.png')


If the gender is equal to m, then a male avatar is set, otherwise a female one. I don't know much about this topic, I don't know how to work with arrays. How can I add a third condition? If $user['id'] == 683 ? ' https://aquaworldonline.ru/img/avatars/full/adm.png '. Those in the know, please help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Soslan Khloev, 2019-01-31
@manavar_g

'bigAva' => ($user['id'] == 683 ? 'https://aquaworldonline.ru/img/avatars/full/adm.png' : ($users['sex'] == 'm' ? 'https://test.aquaworldonline.ru/img/avatars/full/m.png' : 'https://aquaworldonline.ru/img/avatars/full/f.png'))
Probably so

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question