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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 - 35 = ?
Subscribe to this entry?

 
 [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 11:01:30 2024 UTC