guttyguppy Posted February 24, 2008 Share Posted February 24, 2008 hello, If I have a string, can I explode it at one character wthout a delimiter? E.G., could I take abcde and explode it at each character, or would it have to have a delimiter like a,b,c,d,e ?? Thanks! Quote Link to comment Share on other sites More sharing options...
KrisNz Posted February 24, 2008 Share Posted February 24, 2008 try str_split() Quote Link to comment Share on other sites More sharing options...
AndyB Posted February 24, 2008 Share Posted February 24, 2008 In general, you can only explode (or split) on a defined delimiter. However, since strings are arrays, you can abstract individual elements of a string. <?php $var = "abcde"; echo $var{2}; // note curly braces. This displays c, array counts begin at zero ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.