declare or convert a string to array format PHP

Posted by Jamex on Stack Overflow See other posts from Stack Overflow or by Jamex
Published on 2010-06-01T20:32:27Z Indexed on 2010/06/01 20:53 UTC
Read the original article Hit count: 200

Filed under:
|
|
|

How to convert a string format into an array format?

I have a string, $string = 'abcde'

I want to convert it to a 1 element array

$string[0] = 'abcde'

Is there a built in function for this task? Or the shortest way is to

$string = 'abcde';
$array[0] = $string;
$string = $array;

TIA

© Stack Overflow or respective owner

Related posts about php

Related posts about string