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! Link to comment https://forums.phpfreaks.com/topic/92801-using-explode-without-a-delimiter/ Share on other sites More sharing options...
KrisNz Posted February 24, 2008 Share Posted February 24, 2008 try str_split() Link to comment https://forums.phpfreaks.com/topic/92801-using-explode-without-a-delimiter/#findComment-475432 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 ?> Link to comment https://forums.phpfreaks.com/topic/92801-using-explode-without-a-delimiter/#findComment-475433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.