@@ -16,7 +16,7 @@ function post_url_params_result(string $endPoint, array $params = []): string
1616
1717 curl_setopt ($ ch , CURLOPT_URL , $ endPoint );
1818 curl_setopt ($ ch , CURLOPT_POST , true );
19- curl_setopt ($ ch , CURLOPT_POSTFIELDS , http_build_query ($ params ));
19+ curl_setopt ($ ch , CURLOPT_POSTFIELDS , http_build_query ($ params, '' , ' & ' , PHP_QUERY_RFC3986 ));
2020 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true );
2121 // curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
2222 // curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
@@ -25,7 +25,7 @@ function post_url_params_result(string $endPoint, array $params = []): string
2525 curl_setopt ($ ch , CURLOPT_TIMEOUT , 5 );
2626
2727 $ output = curl_exec ($ ch );
28- $ url = "{$ endPoint }? " . http_build_query ($ params );
28+ $ url = "{$ endPoint }? " . http_build_query ($ params, '' , ' & ' , PHP_QUERY_RFC3986 );
2929 // ---
3030 // remove "&format=json" from $url then make it link <a href="$url2">
3131 $ url2 = str_replace ('&format=json ' , '' , $ url );
0 commit comments