Answers for "json_encode with single quotes php"

PHP
9

php json_encode

$person = array( 
    "name" => "Johny Carson", 
    "title" => "CTO"
); 
$personJSON=json_encode($person);//returns JSON string
Posted by: Guest on July-01-2019
0

php json_decode without quotes

function json_decode_add_quotes_to_keys($s) {                      
    $s = preg_replace('/(w+):/i', '"1":', $s);                   
    return json_decode($s);                                        
}
Posted by: Guest on August-21-2020
0

json_encode php

$person = array( 
    "name" => "Johny Carson", 
    "title" => "CTO"
); 
$personJSON=json_encode($person);//returns JSON string

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

$json = array(   
  'message' => $message,
  'func' => $function
);
$string = json_encode($json);
$string = str_replace('"#!!','',$string);
$string = str_replace('!!#"','',$string);
echo $string;
Posted by: Guest on February-28-2022

Code answers related to "json_encode with single quotes php"

Browse Popular Code Answers by Language