Sliipeetais Posted August 26, 2004 Report Share Posted August 26, 2004 Vai ir iespējams apstaigāt visus funkcijai nodotos argumentus, nezinot cik daudz to ir? function diivainis() { //mistisks kods, kas echo visus funkcijai nodotos mainiigos } diivainis("lalalaa", "kakis", "suns", "koks"); // rezultaataa echo lalalaa kakis suns koks diivainis("kakis2", "suns2", "koks2"); // rezultaataa echo kakis2 suns2 koks2 Link to comment Share on other sites More sharing options...
bubu Posted August 26, 2004 Report Share Posted August 26, 2004 Nezinu vai var, bet es laikam rīkotos šādi: <?php function diivainis($params) { foreach($params as $item) { echo $item, ' '; } } diivainis(array('lalalaa', 'kakis', 'suns', 'koks')); diivainis(array('akis2', 'suns2', 'koks2')); ?> Link to comment Share on other sites More sharing options...
spynode Posted August 26, 2004 Report Share Posted August 26, 2004 http://lv.php.net/manual/en/function.func-get-args.php Link to comment Share on other sites More sharing options...
Sliipeetais Posted August 26, 2004 Author Report Share Posted August 26, 2004 Paldies gan bubu, gan spynode. Abi varianti man noderēja. Link to comment Share on other sites More sharing options...
Recommended Posts