Search
 
SCRIPT & CODE EXAMPLE
 

PHP

CONVERTIR TABLEAU EN CHAINE DE CARACTÈRE PHP

//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"}}
Comment

PREVIOUS NEXT
Code Example
Php :: foreach loop in php stack overflow 
Php :: decode a nested JSON with php 
Php :: toggle switch php 
Php :: Laravel Extract Values From Collection Using Pluck() with Relationship 
Php :: causes of class not found in laravel 
Php :: php print html code 
Php :: php Convert multidimensional array into single array 
Php :: Uncaught RedisException: Redis server went away in 
Php :: php sqlite last insert id 
Php :: codeigniter check view file exists 
Php :: pagination using ajax 
Php :: array_diff php 
Php :: the plugin generated 14 characters of unexpected output during activation. if you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin 
Php :: laravel 6 use username on url 
Php :: phpmailer send email to multiple addresses 
Php :: artisan new view 
Php :: Creating dynamic subdomain in php 
Php :: laravel throw 503 
Php :: php variables examples 
Php :: magento Fatal error: Allowed memory size of 134217728 bytes exhausted 
Php :: php get variable name as a string 
Php :: create factory in laravel 8 
Php :: laravel showing index of problem 
Php :: redirect to codeigniter 4 
Php :: define multiple variables in one line php 
Php :: php locale 
Php :: php reverse string 
Php :: laravel route not found 
Php :: Bd phone number validation in laravel 
Php :: php gd coordinate 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =