convert string to array php

December 12, 2011 at 23:48:59
Specs: Windows 7
how can i convert string to simple array.
just like:
$string = 'a,b,c,d,e,f';
convert to array
$arr = array('a','b','c','d','e','f')

See More: convert string to array php

Report •

December 12, 2011 at 23:55:54
You can access a string as if it were a character array: $string[4], for example, in your example would be 'e'.

Report •

December 13, 2011 at 00:14:16
i dont get your answer.
i only want to convert string into array.
input: $string = 'a,b,c,d,e,f';
output: $arr = array('a','b','c','d','e','f');

i need this output and input is in string.

Report •

December 13, 2011 at 00:57:36
I'm not sure that I understand the question. A string already is an array (of characters). But if you want to make a distinct copy of a string just use:

$arr = $string

Report •

Related Solutions

Ask Question