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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 18:01:35 2025 UTC