Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,857 questions

51,778 answers

573 users

How to execute an external program and display the output using system() in PHP

4 Answers

0 votes
// string system( string $command [, int &$return_var ])

$last_line = system('dir *.*', $return_var);
 

 
/*
run:
     
Volume in drive C has no label. Volume Serial Number is 1Q2E-X8V3 Directory of C:\xampp\htd...
. 07/20/2016 10:04 PM 
.. 07/20/2016 11:56 PM 13,911 account.php 07/13/2016 11:59 PM 
bootstrap-3.3.6 07/20/2016 10:00 PM 
bootstrap-3.3.6-source 02/20/2016 01:18 AM 719 connection.php 06/14/2016 10:49 AM 
...
     
*/

 



answered Jul 21, 2016 by avibootz
0 votes
system("calc.exe"); // system("calc");

 
/*
run:

    
*/

 



answered Jul 21, 2016 by avibootz
0 votes
system("notepad"); // system("notepad.exe");

 
/*
run:

    
*/

 



answered Jul 21, 2016 by avibootz
0 votes
system("mspaint"); 
 
/*
run:


    
*/

 



answered Jul 21, 2016 by avibootz

Related questions

2 answers 251 views
251 views asked Jun 15, 2016 by avibootz
1 answer 174 views
1 answer 261 views
3 answers 278 views
...