Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Połączenie wartości w tablicy
winiar789
post
Post #1





Grupa: Zarejestrowani
Postów: 130
Pomógł: 0
Dołączył: 15.11.2011

Ostrzeżenie: (0%)
-----


Mam coś takiego :

Array
(
[0] => Array
(
[data-position] => 1
[data-shopurl] =>nazwaa
[data-offer-price] =>
)

[1] => Array
(
[data-position] =>
[data-shopurl] =>
[data-offer-price] => 458.00
)

[2] => Array
(
[data-position] => 2
[data-shopurl] => nazwaa
[data-offer-price] =>
)

[3] => Array
(
[data-position] =>
[data-shopurl] =>
[data-offer-price] => 469.27
)
)

a chciałbym uzyskać:


Array
(
[0] => Array
(
[data-position] => 1
[data-shopurl] =>nazwaa
[data-offer-price] => 458.00
)

[1] => Array
(
[data-position] => 2
[data-shopurl] => nazwaa
[data-offer-price] => 469.27
)
)

Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
winiar789
post
Post #2





Grupa: Zarejestrowani
Postów: 130
Pomógł: 0
Dołączył: 15.11.2011

Ostrzeżenie: (0%)
-----


Po dodaniu tak usną mi pierwsze array

  1. echo "<pre>";
  2. for($i = 0; $i < count($tablica); ++$i) {
  3. print_R($tablica[$i]);
  4. }
  5. echo "</pre>";


Array
(
[data-position] => 1
[data-shopurl] => nazwa1
[data-offer-price] =>
)
Array
(
[data-position] =>
[data-shopurl] =>
[data-offer-price] => 458.00
)
Array
(
[data-position] => 2
[data-shopurl] => nazwa2
[data-offer-price] =>
)
Array
(
[data-position] =>
[data-shopurl] =>
[data-offer-price] => 469.27
)
Array
(
[data-position] => 3
[data-shopurl] => nazwa3
[data-offer-price] =>
)
Array
(
[data-position] =>
[data-shopurl] =>
[data-offer-price] => 489.94
)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 4.10.2025 - 02:48