John Davidson

PHP Convert multidimensional array to a string (LITERALLY)

0 comments
Message:


I have a PHP multidimensional array that looks like this:


[[1,45],[2,23],[3,37],[4,51],[5,18],[6,32],[7,29],[8,45],[9,37],[10,50]]

(Those numbers are stored as strings, not int)


What I want is to convert this multidimensional array to a string that teorically is stored like this:


$converted = "[[1,45],[2,23],[3,37],[4,51],[5,18],[6,32],[7,29],[8,45],[9,37],[10,50]]";

Literally all the array in one string


currently I have the array stored in a variable named $array



My Answer:
"[[1,45],[2,23],[3,37],[4,51],[5,18],[6,32],[7,29],[8,45],[9,37],[10,50]]"

Rate this post

3 of 5 based on 1239 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us