|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-09-12 18:40 UTC] dev at glossword dot info
[2007-09-13 07:52 UTC] jani@php.net
[2007-09-13 07:54 UTC] jani@php.net
[2007-09-13 12:47 UTC] dev at glossword dot info
[2007-09-13 12:55 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 20:00:02 2025 UTC |
Description: ------------ Hi. Before to make this post, I have read all previous bugs related to `parse_str()` and user comments in documentation for `parse_str()` function. Perhaps, this is not a bug but "consistent behavior"... Anyway, it didn't work as expected and it makes a trouble for me. Reproduce code: --------------- $str1 = '&arg1=123&arg2="Company&Sons" '90'; $str2 = '&arg1=123&arg2="Company&Sons" \'90'; parse_str($str1, $array1); parse_str( html_entity_decode($str1), $array2 ); parse_str($str2, $array3); parse_str( html_entity_decode($str2), $array4 ); print_r( $array1 ); print_r( $array2 ); print_r( $array3 ); print_r( $array4 ); Expected result: ---------------- Array ( [arg1] => 123 [arg2] => "Company&Sons" '90 ) Array ( [arg1] => 123 [arg2] => "Company&Sons" '90 ) ... Actual result: -------------- Array ( [arg1] => 123 [arg2] => [quot;Company] => [amp;Sons] => [quot;_] => [#039;90] => ) Array ( [arg1] => 123 [arg2] => "Company [Sons"_] => [#039;90] => ) Array ( [arg1] => 123 [arg2] => "Company [Sons"_'90] => ) Array ( [arg1] => 123 [arg2] => "Company [Sons"_'90] => )