Answer the question
In order to leave comments, you need to log in
Is it possible to get a one dimensional array of values in PHP?
There is an array
[0=>'value1', 1=>'value2', ...]
is it possible to get a one-dimensional array of values from it without explicitly bypassing it
['value1', 'value2']
by Php or Yii2 functions
Answer the question
In order to leave comments, you need to log in
a strange question, because ['value1', 'value2'] is the same as [0=>'value1', 1=>'value2', ...]
print_r(['value1', 'value2']);
print_r([0=>'value1', 1=>'value2']);
Good afternoon.
How to bypass the array in php has already been suggested to you by Maxim Fedorov.
yii2 has a helper, ArrayHelpers . You can use it to process arrays.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question