Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Nazwa indexu o danej wartości?, Jak pobrać nazwe danego serwisu?
rafcio8405
post 9.03.2005, 00:19:43
Post #1





Grupa: Zarejestrowani
Postów: 76
Pomógł: 0
Dołączył: 25.02.2004
Skąd: Warszawa

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


Mam taki problem chce z tablicy pobrać nazwę indexu (adres) czy jest jakaś funkcja do tego.

Przykład:
Kod
$array= array( "Biały" => "Człowiek",
"Zielony" => Kwiat,
"Czerwona" => "Róża);


--------------------
...::: R @ F I & S @ L I :::...
PrivateServ
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
Darti
post 9.03.2005, 00:41:51
Post #2





Grupa: Zarejestrowani
Postów: 1 076
Pomógł: 62
Dołączył: 6.03.2005
Skąd: Wroc

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


http://pl.php.net/manual/pl/function.key.php


--------------------
The answer is out there, Neo. It's looking for you. And it will find you, if you want it to.
SERVER_SOFTWARE : Apache/2.2.4 (Win32) PHP/5.2.1
MySQL Client API version : 5.0.27
Go to the top of the page
+Quote Post
tts
post 9.03.2005, 00:42:14
Post #3





Grupa: Zarejestrowani
Postów: 91
Pomógł: 0
Dołączył: 14.02.2005

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


  1. <?php
  2. $array= array( &#092;"Biały\" => \"Człowiek\", \"Zielony\" => Kwiat, \"Czerwona\" => \"Róża\");
  3.  
  4. foreach($array $klucz => $wartosc)
  5.    echo &#092;"$klucz\";
  6. ?>


o to chodzilo? no oczywiscie trzeba dopisac warunek zeby zwracal klucz o zadanej wartosci ale to chyba juz nie problem.

albo tak jak napisal Darti.
no i jeszcze masz i "... - Water's wet, the sky is blue and old Satan Claus Jimmy, he's out there and he just gettin' stronger.
- So what do we do about that?
- Be prepared son that's my motto, be prepared..."
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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 09:12