📜  php json_encode 中的 javascript 函数 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:30.390000             🧑  作者: Mango

代码示例1
$function = "#!!function(){}!!#"; 
$message = "Hello";

$json = array(   
  'message' => $message,
  'func' => $function
);
$string = json_encode($json);
$string = str_replace('"#!!','',$string);
$string = str_replace('!!#"','',$string);
echo $string;