//Syntax: string implode($separator, $array)
<?php
// Declare an array
$arr = array("Welcome","to", "GeeksforGeeks",
"A", "Computer","Science","Portal");
// Converting array elements into
// strings using implode function
echo implode(" ",$arr);
?>
//OUTPUT
Welcome to GeeksforGeeks A Computer Science Portal
//Syntax : string json_encode( $value, $option, $depth )
<?php
// Declare multi-dimensional array
$value = array(
"name"=>"GFG",
array(
"email"=>"abc@gfg.com",
"mobile"=>"XXXXXXXXXX"
)
);
// Use json_encode() function
$json = json_encode($value);
// Display the output
echo($json);
?>
//OUTPUT
{"name":"GFG","0":{"email":"abc@gfg.com","mobile":"XXXXXXXXXX"}}