Hello, how can I convert a string with double quotes into an array? Is there a function for doing it?
for example
$string = "\"one\", \"two\"";
$array1 = array($string);
if i echo $array1[0] it will display "one", "two" and if I echo $array1[1] it will display nothing, what I want to do is to store the string to $array1 like this, $array1 = array("one","two") so that if I echo $array1[0] it will display one and if I echo $array1[1] it will display two.
Unless they start over from scratch and make it a proper single player Marathon sequel with deathmatch all all that stuff like Halo, they should just cancel it.
Question
mcs2k1
Hello, how can I convert a string with double quotes into an array? Is there a function for doing it?
for example
$string = "\"one\", \"two\"";
$array1 = array($string);
if i echo $array1[0] it will display "one", "two" and if I echo $array1[1] it will display nothing, what I want to do is to store the string to $array1 like this, $array1 = array("one","two") so that if I echo $array1[0] it will display one and if I echo $array1[1] it will display two.
How will I do it? Thank you very much, :)
Link to comment
https://www.neowin.net/forum/topic/614420-php-strings-with-double-quotes-to-array/Share on other sites
4 answers to this question
Recommended Posts