javascript function in php json encode

Solutions on MaxInterview for javascript function in php json encode by the best coders in the world

showing results for - "javascript function in php json encode"
Sara
14 Nov 2020
1$function = "#!!function(){}!!#"; 
2$message = "Hello";
3
4$json = array(   
5  'message' => $message,
6  'func' => $function
7);
8$string = json_encode($json);
9$string = str_replace('"#!!','',$string);
10$string = str_replace('!!#"','',$string);
11echo $string;
12