|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-11-08 03:56 UTC] Otto dot Stolz at uni-konstanz dot de
parse_url('mailto:Otto.Stolz@uni-konstanz.de')
yields:
array( ['scheme'] => 'mailto'
['path'] => 'Otto.Stolz@uni-konstanz.de'
)
According
to <http://www.zvon.org/tmRFC/RFC2368/Output/chapter2.html>
and <http://www.zvon.org/tmRFC/RFC2822/Output/chapter3.html#sub4>,
it should rather yield:
array( ['scheme'] => 'mailto'
['host'] => 'uni-konstanz.de'
['user'] => 'Otto.Stolz'
)
A test page can be found at
<http://www.rz.uni-konstanz.de/Antivirus/tests/parse_url.php>,
the pertinent PHP source at
<http://www.rz.uni-konstanz.de/Antivirus/tests/parse_url.txt>.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 01:00:01 2025 UTC |
After much back-and-forth on php-dev it was decided to leave parse_url() as is. To achieve the functionality you're looking for try something like the following: $addr = parse_url('mailto:testuser@example.com?Subject=Here+is+an+email'); list($email,$params) = explode("?",$addr,2); list($user,$host) = explode("@",$email,2); // $user == "testuser"; // $host == "example.com"; // $params = "Subject=Here+is+an+email";