php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14701 Execute program
Submitted: 2001-12-26 12:47 UTC Modified: 2001-12-28 20:44 UTC
From: ngotau at hotmail dot com Assigned:
Status: Not a bug Package: Program Execution
PHP Version: 4.1.0 OS: Windows2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ngotau at hotmail dot com
New email:
PHP Version: OS:

 

 [2001-12-26 12:47 UTC] ngotau at hotmail dot com
I tried to exec simple program like as :
exec("dir C:",$results,$status)
but the $results return [Array] with out any string .
and $status return 0 .
How I can handle result ? 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-26 18:26 UTC] imajes@php.net
What you are describing is normal behaviour.

The way exec() works is that it executes the first argument, and then returns all the output to the second argument as an array. Finally, any status the command returns is sent to the third argument, if specified. 

You may find these pages informative:

http://www.php.net/manual/en/function.exec.php
http://www.php.net/manual/en/ref.array.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC