man.without.name Posted May 24, 2006 Report Share Posted May 24, 2006 vajag kaut kā izpildīt PHP skriptu, precīzāk izsaukt funkciju zinot tās nosaukumu un parametrus, nu apmēram tā: $f_name = "drop_the_directory"; $f_params = array; $f_params[] = "c:\sx"; call_function($fname, $f_params) vai to maz var kautkā izdarīt???? paldies Link to comment Share on other sites More sharing options...
GedroX Posted May 24, 2006 Report Share Posted May 24, 2006 call_user_func_array() Link to comment Share on other sites More sharing options...
Blitz Posted May 24, 2006 Report Share Posted May 24, 2006 funkcija eval varetu palidzet... Link to comment Share on other sites More sharing options...
bubu Posted May 24, 2006 Report Share Posted May 24, 2006 $$f_name(1,2,..) arī laikam strādās. Link to comment Share on other sites More sharing options...
GedroX Posted May 24, 2006 Report Share Posted May 24, 2006 (edited) $$f_name(1,2,..) arī laikam strādās. Ļoti šaubos. :) <?php function printError($s) { echo '<div style="color: red;">' . $s . '</div>'; } $func_name = 'printError'; $func_name('Texts'); ?> šis gan strādā (kāpēc neiet ar standarta funkcijām echo, print?...) Edited May 24, 2006 by GedroX Link to comment Share on other sites More sharing options...
v3rb0 Posted May 24, 2006 Report Share Posted May 24, 2006 php4 šitā function my_dummy_function() { print_r(func_get_args()); } $f_name = 'my_dummy_function'; $f_name(1,2); Link to comment Share on other sites More sharing options...
GedroX Posted May 24, 2006 Report Share Posted May 24, 2006 Vienalga esmu par funkcijas call_user_func_array() izmantošanu. Link to comment Share on other sites More sharing options...
bubu Posted May 24, 2006 Report Share Posted May 24, 2006 Ā nu jā, laikam ar vienu $ pietika. GedroX: tāpēc, ka echo un print nav funkcijas, bet valodas konstrukcijas (tas minēts manuālī). Link to comment Share on other sites More sharing options...
Recommended Posts