<code><span><span>function</span><span>console_log</span><span>(<span>$data</span>)</span>{</span><span>if</span> (is_array(<span>$data</span>) || is_object(<span>$data</span>)){ <span>echo</span>(<span>"<script>console.log('"</script></span>.json_encode(<span>$data</span>).<span>"');"</span>); } <span>else</span> { <span>echo</span>(<span>"<script>console.log('"</script></span>.<span>$data</span>.<span>"');"</span>); } } </code>
以上就介绍了打印php信息的方法,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。