php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19997 explode() has bug
Submitted: 2002-10-20 01:00 UTC Modified: 2002-10-20 14:21 UTC
From: adin at austin dot rr dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.2.1 OS: Linux (Enigma)
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: adin at austin dot rr dot com
New email:
PHP Version: OS:

 

 [2002-10-20 01:00 UTC] adin at austin dot rr dot com
$split = explode("|", $DaysOfWeek);
for ($x = 0; $split[$x]; $x++) {
   echo $split[$x]."\n";
}

//if $DaysOfWeek starts with 0 (eg. 0|1|2) then $split
//gets blanked. 1|2|3 or any other combination is fine.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-20 01:34 UTC] iliaa@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.

Works fine in CVS.
 [2002-10-20 14:21 UTC] rasmus@php.net
Your for loop will obviously not start if $split[0] is 0 since you are using $split[$x] directly as your condition expression.  0 evaluates to false.  Use a foreach() loop instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 01 19:01:30 2024 UTC