shage Posted July 26, 2008 Share Posted July 26, 2008 function test(){ $handle = file("file.txt"); $sexy = array($handle); $count = count($sexy, COUNT_RECURSIVE); for ($i=0;$i<=$count;$i=$i+1) { $kk = $sexy[0][$i]; run_function("$kk","1","1"); } } anyone know what is wrong with this, some reason it doesnt pass the array to the function thank you Link to comment https://forums.phpfreaks.com/topic/116685-php-loop/ Share on other sites More sharing options...
Third_Degree Posted July 26, 2008 Share Posted July 26, 2008 the file() function already returns an array... Link to comment https://forums.phpfreaks.com/topic/116685-php-loop/#findComment-599970 Share on other sites More sharing options...
shage Posted July 26, 2008 Author Share Posted July 26, 2008 any idea on how to get it to run the function with each line, im about to throw this comp Link to comment https://forums.phpfreaks.com/topic/116685-php-loop/#findComment-599991 Share on other sites More sharing options...
Third_Degree Posted July 26, 2008 Share Posted July 26, 2008 umm...something like this...not sure what you're trying to do $file = file( 'file.txt' ); foreach( $file as $line ) { run_function( $line, '1', '1' ); } Link to comment https://forums.phpfreaks.com/topic/116685-php-loop/#findComment-599992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.