Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

javascript function in php json_encode

$function = "#!!function(){}!!#"; 
$message = "Hello";

$json = array(   
  'message' => $message,
  'func' => $function
);
$string = json_encode($json);
$string = str_replace('"#!!','',$string);
$string = str_replace('!!#"','',$string);
echo $string;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #function #php
ADD COMMENT
Topic
Name
4+6 =