<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('"</span>.json_encode(<span>$data</span>).<span>"');</script>"</span>); } <span>else</span> { <span>echo</span>(<span>"<script>console.log('"</span>.<span>$data</span>.<span>"');</script>"</span>); } } </code>
以上就介紹了列印php資訊的方法,包括了方面的內容,希望對PHP教程有興趣的朋友有幫助。