Skip to main content

Posts

Showing posts with the label format output text php using shell_exec function

format output text php using shell_exec function

Hi there if you face this nagging thing that the output of shell_exec command is appering in one long line you must keep reading this super easy solution you will thank me after that let say the output is saved in $output variable <php     $output = shell_exec($cmd);     echo $output;  # will pring a long line with the output    # in order to fix the output to get line breaks  use this code   foreach(preg_split("/((\r?\n)|(\r\n?))/", $output_including_status) as $line){   {          echo "<br/>";          echo $line;    } ?> have fun. support me.