Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php array to string

// for one-dimentional arrays
$str = implode('|', $arr);	// "v1|v2|v3"...

// for multi-dimensional/structured arrays, or to keep hierarchy
$str = json_encode($arr);
// or
$str = var_export($arr);
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #php #array #string
ADD COMMENT
Topic
Name
4+3 =