zizzu Posted March 21, 2011 Share Posted March 21, 2011 Hello i am trying to execute a linux program for every line of a textarea $text = $_POST['links']; $text = htmlspecialchars($_POST['links']); $text = nl2br($text); foreach(explode("\n",$text) as $row) { $result = NULL; $command = 'the command'; exec($command,&$result); echo $result[0]."<br>"; } but this always print the result for last line of text area for example if there are 3 lines it print 2 blanks and 1 result... whats wrong?? Link to comment https://forums.phpfreaks.com/topic/231277-exec-foreach/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.