Re: converting multi-dim arrays to php assoc arrays

Поиск
Список
Период
Сортировка
От Arjen van der Meijden
Тема Re: converting multi-dim arrays to php assoc arrays
Дата
Msg-id 003c01c2cabf$b4a5bc40$3ac15e91@acm
обсуждение исходный текст
Ответ на converting multi-dim arrays to php assoc arrays  (John Smith <john_smith_45678@yahoo.com>)
Список pgsql-general
What about something like:
// strip off the first {{ and last }}
$array = explode('},{', $pg_array);
$php_array = array();
foreach($array as $elements)
{
   $temp_array = explode(',', $elements);
   $php_array[$temp_array[0]] = $temp_array[1];
}

This is not a very generic solution though.

Regards,

Arjen

Van: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] Namens John Smith
Verzonden: zondag 2 februari 2003 10:37
Aan: pgsql-general@postgresql.org
Onderwerp: [GENERAL] converting multi-dim arrays to php assoc arrays


Anybody have a method for converting multi-dimensional PG columns to PHP
associative arrays? ie.
{{1,123},{2,234},{3,345},{4,456}}
becomes
1 => 123, 2 => 234, 3=> 345, 4 => 456




Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now



В списке pgsql-general по дате отправления:

Предыдущее
От: Arjen van der Meijden
Дата:
Сообщение: Re: What is the benefit of schemas?
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: php 4.2 postgresql 7.3 help