php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27883 I cannot use the explode() command for a string generated with `ls`
Submitted: 2004-04-06 05:30 UTC Modified: 2004-04-06 07:53 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lord_ali at nextra dot ro Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.5 OS: apache 2.0.48
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lord_ali at nextra dot ro
New email:
PHP Version: OS:

 

 [2004-04-06 05:30 UTC] lord_ali at nextra dot ro
Description:
------------
I wanted to read all the files from a directory and split them in diferent variables.

./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql=/usr/local/mysql' '--with-pgsql=/usr/local/pgsql/' 

Reproduce code:
---------------
<?php
$ali = `ls`;
$oficial = explode(" ", $ali);
echo "oficial[0]<br>";
echo "oficial[1]<br>";
echo "oficial[2]<br>";
echo "oficial[3]";
?>


Expected result:
----------------
I would expect to see the files in the directory listed one below the other. 

Actual result:
--------------
I am seeing all the files in one line.... not in diferent lines. Only $oficial[0] is listed, the rest of variables are empty

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-06 07:53 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 06:01:31 2024 UTC