<?php $str="name1=value1&name2=value2&name3=value3"; parse_str($str,$array); var_dump( $array ); ?> ●実行結果 array(3) { ["name1"]=> string(6) "value1" ["name2"]=> string(6) "value2" ["name3"]=> string(6) "value3" }
<?php $str="name1=value1&name2=value2&name3=value3";parse_str($str); print $name1 . "\n"; print $name2 . "\n"; print $name3 . "\n"; ?> ●実行結果 value1 value2 value3