I want to set a favicon icon on this page, but I cannot do it by echo
because the PHP
is going to echo
out JSON
format. How do I do it?
if I add this line It is mixing up with my main output
echo '<link rel="icon" href="/favicon.ico" type="image/x-icon">';
the output I'm getting
<link rel="icon" href="/favicon.ico" type="image/x-icon">hello world
my PHP
code
<?php
header('Content-Type: application/json');
class Main {
function mFun() {
echo "hello world";
}
}
$main = new Main();
echo '<link rel="icon" href="/favicon.ico" type="image/x-icon">';
$main -> mFun();
?>
UPDATE
why anyone not noticing header('Content-Type: application/json');