“PHP Print to Console” Kode Jawaban

Log Konsol PHP

// Assuming you are wishing to log to the JS Console...

<?php
	function consoleLog($msg) {
		echo '<script type="text/javascript">' .
          'console.log(' . $msg . ');</script>';
	}

	consoleLog('Hello, console!');
?>
Kaotik

console.log dalam php

/*
console.log in php
*/

<?php
	function consoleLog($message) {
		echo '<script type="text/javascript">' .
          'console.log(' . $message . ');</script>';
	}

	consoleLog('Hello, greppers!');
?>
Ankur

Output konsol PHP

<?php
  
  $message = "Thanks..";
  
  echo "<script>console.log('".$message."');</script>";
  
?>
    
Output: Thanks..
SECRET MYSTERY

PHP Print to Console

<script>
    console.log(<?= json_encode($foo); ?>);
</script>
Upset Unicorn

PHP Console Print

$a = array(
 null => 'a',
 true => 'b',
 false => 'c',
 0 => 'd',
 1 => 'e',
 '' => 'f'
);

echo count($a), "\n";
Shiny Skylark

Jawaban yang mirip dengan “PHP Print to Console”

Pertanyaan yang mirip dengan “PHP Print to Console”

Lebih banyak jawaban terkait untuk “PHP Print to Console” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya