A
A
a_donov2018-04-05 23:06:45
PHP
a_donov, 2018-04-05 23:06:45

How to organize an array structure?

In the function we have 2 queries:

function сategory_call() {
  $result['category']	= explode( "_", self::get_field() );
  $result['catalogue']	= self::get_сategory();
  ...
}

where self::get_field() returns a string of the form 1_2_5_11 (I used this value below)
these are unique values ​​and their number is a maximum of 16,
and self::get_category() in turn returns an object of the form
[
  1: Первый
  2: Второй
  3: Третий
  ...
  16: Шестнадцатый
]

Also a maximum of 16.
You need to create a combined view object
[
  1: {"Первый":"1"}
  2: {"Второй":"2"}
  3: {"Третий":"null"}
  ...
  16: {"Шестнадцатый":"null"}
]

where the self::get_category() object is taken as a basis and self::get_field() data is imported into it, COMPARING
the keys of one array and the values ​​of the second.
The output format is not critical, the main thing is that each value has all 3 fields.
Tell me where to start, how to compare the keys and values ​​of different arrays, while collecting them into one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kenny_opennix, 2014-02-17
@kenny_opennix

in pycharm change the default interpreter.
Everything works correctly for me on Mavericks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question