spynode Posted July 15, 2004 Report Share Posted July 15, 2004 Man pašam kautkā nesanāk iedziļināties šajā arrayu padarīšanā tādēļ ceru, ka man kāds palīdzēs. Gribu uztaisīt Arraju ar struktūru modulja vaards -> fails piemeeram 'galerija' -> 'galerija.php', 'raksti' -> 'raksti.php' utt. un pēc tam ģenerēt linkus no šiem arrajiem apm. <a href="galerija.php">galerija</a> utt. Nu es ceru, ka ideju sapratāt. Man pašam nav nācies ar arrajiem īpaši saskarties tapēc ceru, ka palīdzēsiet. Link to comment Share on other sites More sharing options...
_Rein_ Posted July 15, 2004 Report Share Posted July 15, 2004 Vaitad tieshaam ir taads slinkums apskatiities php dokumentaacijaa?? ;) Un vispaar, a tev vienkaarshaak nebuutu to sarakstu gjenereet automaatiski peec atrastajiem failiem konkreetaa direktorijaa?? Link to comment Share on other sites More sharing options...
spynode Posted July 15, 2004 Author Report Share Posted July 15, 2004 Nee labaak buutu shitaa. Nu es skatijos, bet iisti nesapratu. Nu es varu dabuut arraya veertiibu aaraa , bet kaa es varu dabuut araa arraja daljas nosaukumu? piem. $arrays['gallery'] = 'gallery.php'; ka es varu dabuut araa tieshi to arraya daljas nosaukumu gallery lai vareetu gjenereet linkus kaa ieprieksh mineju. Un vispaar, ja nevari paliidzeet, labaak nepiesaarnjo forumu ar mazveertiigiem padomiem. Link to comment Share on other sites More sharing options...
Aleksejs Posted July 15, 2004 Report Share Posted July 15, 2004 Varbūt šis: http://lv.php.net/manual/en/function.key.php ;) Link to comment Share on other sites More sharing options...
spynode Posted July 15, 2004 Author Report Share Posted July 15, 2004 Tieši tas, ko man vajadzēja. Paldies tev. Link to comment Share on other sites More sharing options...
Venom Posted July 16, 2004 Report Share Posted July 16, 2004 (edited) Ūja, ūja! Var tač' vieglāk, ar foreach konstrukciju: $action=array('Galerija'=>'gallery','Jaunumi'=>'news'); //var arī tā $action['buj']=>'faq'; foreach($action as $arr_key=>$arr_val) echo '<a href="'.$arr_val.'.php">'.$arr_key.'</a>'; see also: in_array(), array_keys(), array_values(), array_key_exists(), array_shift(), array_pop(), list(), each() att. uz 2 pēdējiem while(list($arr_key,$arr_val)=each($action)) analoģisks foreach(), bet strādā lēnāk Edited July 16, 2004 by Venom Link to comment Share on other sites More sharing options...
Venom Posted July 16, 2004 Report Share Posted July 16, 2004 Ūja, ūja! Var tač' vieglāk: $action=array('Galerija'=>'gallery Link to comment Share on other sites More sharing options...
Recommended Posts