The receiving end is Print_r ($_post);
The sending side writes a curl to submit the post.
$ch = Curl_init (); Curl_setopt_array ($ch, array (curlopt_url = ' http://myurl/abc.php ', Curlopt_returntransfer = True,curlopt_post = True,curlopt_postfields = ' name=abc&id=123 '); $content = curl_exec ($ch);p Rint_r ($ content); Echo '
=========
'; Echo $content [' name '];
Print out the results:
Array ( [name] = + ABC [id] = 123) =========a
Why $content[' name ' gets a letter a ...
Reply content:
The receiving end is Print_r ($_post);
The sending side writes a curl to submit the post.
$ch = Curl_init (); Curl_setopt_array ($ch, array (curlopt_url = ' http://myurl/abc.php ', Curlopt_returntransfer = True,curlopt_post = True,curlopt_postfields = ' name=abc&id=123 '); $content = curl_exec ($ch);p Rint_r ($ content); Echo '
=========
'; Echo $content [' name '];
Print out the results:
Array ( [name] = + ABC [id] = 123) =========a
Why $content[' name ' gets a letter a ...
$content = curl_exec ($ch);
This line of code gets the $content is a string. So you print this string when you echo.
Change the Print_r to Var_dump.
Var_dump ($content);
Get results:
String "Array ( [name] + ABC [id] = 123)"
echo $content [' name ']; This sentence
$content is a string where ' name ' is being multiplied by the integer 0, so it is the first letter A.