Execute a system command: Difference between revisions

Content added Content deleted
(add m4)
Line 418: Line 418:
echo nl2br($output);</lang>
echo nl2br($output);</lang>
'''Note:'''The '@' is here to prevent error messages to be displayed, 'nl2br' translate '\n' chars to 'br' in HTML.
'''Note:'''The '@' is here to prevent error messages to be displayed, 'nl2br' translate '\n' chars to 'br' in HTML.

Other:
$results = `ls`;
# runs command and returns its STDOUT as a string
system("ls");
# runs command and returns its exit status; its STDOUT gets output to our STDOUT
echo `ls`;
#The same, but with back quotes


=={{header|Pop11}}==
=={{header|Pop11}}==