PHP中return和echo的区别

来源:互联网 发布:网络舆情汇报 编辑:程序博客网 时间:2024/04/30 16:40

使用.的输出


function show1(){


echo "hello,world";
}


function show2(){


return "hello,world";
}


echo "PHP7:".show1(); //hello,worldPHP7:
echo "<hr/>";
echo "PHP7:".show2(); //PHP7:hello,world
echo "<hr/>";



使用,的输出


function test1(){
    echo "I want to learn haskell";
}
function test2(){
    return "I want to learn NodeJS";
}
ECHO "hello:",test1();  //hello:I want't to learn haskell
echo "<hr />";
echo "hello:",test2();  //hello:I want't to learn NodeJS
0 0
原创粉丝点击