|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-30 00:30 UTC] johannes@php.net
[2009-12-30 19:48 UTC] dlazesz at walla dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
Description: ------------ last "<" character drops the rest of the field with explode and preg_split Reproduce code: --------------- print_r(explode(",",'"Foo Bar" <foobar@example.com>, Second address...')); print_r(preg_split("/,/",'"Foo Bar" <foobar@example.com>, Second address...')); print_r(explode(",",'"Foo Bar" foobar@example.com>, Works.')); print_r(preg_split("/,/",'"Foo Bar" foobar@example.com>, Works.')); print_r(explode(",",'"Foo Bar" <<foobar@example.com>, Something missing.')); print_r(preg_split("/,/",'"Foo Bar" <<foobar@example.com>, Something missing.')); Expected result: ---------------- Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Second address... ) Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Second address... ) Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. ) Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. ) Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Something missing. ) Array ( [0] => "Foo Bar" <foobar@example.com> [1] => Something missing. ) Actual result: -------------- Array ( [0] => "Foo Bar" [1] => Second address... ) Array ( [0] => "Foo Bar" [1] => Second address... ) Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. ) Array ( [0] => "Foo Bar" foobar@example.com> [1] => Works. ) Array ( [0] => "Foo Bar" < [1] => Something missing. ) Array ( [0] => "Foo Bar" < [1] => Something missing. )