Question: I have string like so `$string = 0730` I am looking to spilt this into an array like so:

```
$string[0] = 0
$string[1] = 7
$string[2] = 3
$string[3] = 0

```

I have looked into explode, but I do not have a delimiter or would just `""` work?

Or is there another php function I should use?

Answer: 
use **[str\_split()](http://php.net/manual/en/function.str-split.php)** function

```
$string = '0730';
print_r(str_split($string));

```

output:

```
Array
(
    [0] => 0
    [1] => 7
    [2] => 3
    [3] => 0
)

```
You can just access the string as an array:

```
$string = "0730";
echo $string[1]; // 7

```

But if you need an array (for using in `array_map` or something), use [`str_split`](http://php.net/str-split)