This post was last edited by u012314326 on 2013-10-02 17:04:39
http://cn2.php.net/manual/zh/function.print-r.php
1. "Print_r () moves the pointer of the array to the last edge. Use Reset () to get the pointer back to the beginning "
What do you mean by this sentence?
2. "If you want to capture the output of Print_r (), you can use the return parameter. If this parameter is set to TRUE, Print_r () will not print the result (this is the default action), but instead return its output. ”
What do you mean by this sentence?
3. What role does this function have in actual programming?
Reply to discussion (solution)
$arr =array ("1" =>1, "2" =>2);
$result =print_r ($arr, TRUE);
echo $result;
1. "Print_r () moves the pointer of the array to the last edge. Use Reset () to get the pointer back to the beginning "
$ar = Array (' a ' = = 1, ' b ' = + 2); Echo current ($ar); 1print_r ($ar); Echo current ($ar); 1
The description is outdated.
2. "If you want to capture the output of Print_r (), you can use the return parameter. If this parameter is set to TRUE, Print_r () will not print the result (this is the default action), but instead return its output. ”
$ar = Array (' a ' = = 1, ' b ' = + 2); $s = Print_r ($ar, 1);
3. What role does this function have in actual programming?
This function is generally used in the process of debugging