Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wyciągnięcie danych z POST, Array
--armind--
post
Post #1





Goście







  1. $process = array('regards' => $_POST['regards'][123]);
  2. while (list($key, $val) = each($process)) {
  3. foreach ($val as $k => $v) {
  4. $process[$key][$k] = $v;
  5. }
  6. }
  7. echo $process['regards'];


jak wyciągnąć z tego kawałka kodu te cyfry 123, bawie się z tym i nic mi nie wychodzi ;(

Dziękuje za pomoc.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 11)
Kshyhoo
post
Post #2





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




Magia print_r została wykorzystana?


--------------------
Go to the top of the page
+Quote Post
--armind--
post
Post #3





Goście







Nic nie wyswietla, pusto. Coś tutaj coś jest nie tak i sam już nie wiem.
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #4





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




No to co chcesz wyciągnąć, jak pusto? W magika się bawisz? A pochwal się, jak użyłeś print_r.


--------------------
Go to the top of the page
+Quote Post
--armind--
post
Post #5





Goście







  1. print_r($process);
  2. print_r($process['regards'];
  3.  
  4. $process = array('regards' => $_POST['regards'][123]);
  5. print_r($process['regards'];
  6. print_r($process);



Na różne sposoby i biała strona...
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #6





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




To mnie interesowało:
  1. print_r($_POST);


--------------------
Go to the top of the page
+Quote Post
--armind--
post
Post #7





Goście







Pusto

  1. Array ( )


Bardzo prosze was o pomoc bo 2 dzien już mam z tym problem.
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #8





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




A tak:
  1. print_r($process);


--------------------
Go to the top of the page
+Quote Post
--armind--
post
Post #9





Goście







Teraz to sie wyswietliło:

  1. Array ( [regards] => )
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #10





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




No, a tak:
  1. print_r($process['regards'];


--------------------
Go to the top of the page
+Quote Post
--armind--
post
Post #11





Goście







Biała strona, czyli pusto nic.
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #12





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




Bo Twoja tablica jest pusta smile.gif Ale tak, już nie:
  1. $_POST['regards'] = 123;
  2. $process = array('regards' => $_POST['regards']);
  3.  
  4. foreach($process as $klucz=>$wartosc) {
  5. echo "$klucz - $wartosc<br />";
  6. }


--------------------
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 10:14