function printmsg($string,$type) {//type 1 = green, type 2 = red
if($type == 1) $msg = "<p style=\"color:#00C5CD\">".$string."</p>";
if($type == 2) $msg = "<p style=\"color:#f7110b\">".$string."</p>";
return $msg;
}
printmsg("hello",1);
//lots of other code
print($msg);
我试图让我的返回值打印出来,但它似乎从来没有工作过。