时间:2021-07-01 10:21:17 帮助过:6人阅读
- <br><?php <br>function show_var($var) { <br>if (is_scalar($var)) { <br>echo $var; <br>} else { <br>var_dump($var); <br>} <br>} <br>$pi = 3.1416; <br>$proteins = array("hemoglobin", "cytochrome c oxidase", "ferredoxin"); <br><br>show_var($pi); <br>// 打印:3.1416 <br><br>show_var($proteins) <br>// 打印: <br>// array(3) { <br>// [0]=> <br>// string(10) "hemoglobin" <br>// [1]=> <br>// string(20) "cytochrome c oxidase" <br>// [2]=> <br>// string(10) "ferredoxin" <br>// } <br>?> <br>