php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49644 explode() does not work in this case
Submitted: 2009-09-23 13:39 UTC Modified: 2009-09-24 19:29 UTC
From: iddover at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.3.0 OS: Centos 5.2
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: iddover at gmail dot com
New email:
PHP Version: OS:

 

 [2009-09-23 13:39 UTC] iddover at gmail dot com
Description:
------------
Explode doesn't works in this case

Reproduce code:
---------------
<?php
$boundary = "--========/4ab98633000bec76/empmaa12.ono.com";
$content = file_get_contents('merda.eml.txt');

print_r( explode($boundary, $content));

?>

Expected result:
----------------
To explode into array?

Actual result:
--------------
Array with only 1 element

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-23 16:20 UTC] jani@php.net
And what might that file contain?
 [2009-09-24 18:20 UTC] iddover at gmail dot com
I think is not the only case, 

http://cms.tempel.es/merda.eml.txt
 [2009-09-24 19:29 UTC] sjoerd@php.net
Thank you for your bug report.

The behavior you report is not a bug. The boundary you specify simply does not occurs in the file. Note that explode() is case sensitive. The boundary in the file is uppercase, and in your variable it is lowercase.

// In file:  --========/4AB98633000BEC76/empmaa12.ono.com
$boundary = "--========/4ab98633000bec76/empmaa12.ono.com";
Different:               ^^        ^^^
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 19:01:31 2024 UTC