AbydosGater Posted February 26, 2007 Share Posted February 26, 2007 Hi, I started on a project today and i need to be able to take a string and explode every character into an array, is this possible? I know explode works but it seperates after each character indicated in the function. Is there any way to do this for each character in a string? Thanks, Andy. Quote Link to comment Share on other sites More sharing options...
Barand Posted February 26, 2007 Share Posted February 26, 2007 PHP5 has str_split(). But you can treat as a string as an array of chars anyway. $str = 'hello; echo $str{1}; // e Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted February 26, 2007 Author Share Posted February 26, 2007 Ah Great Thanks! Quote Link to comment Share on other sites More sharing options...
lifeson2112 Posted February 26, 2007 Share Posted February 26, 2007 That's dope Quote Link to comment Share on other sites More sharing options...
Barand Posted February 26, 2007 Share Posted February 26, 2007 Would you care to explain that comment? Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted February 26, 2007 Author Share Posted February 26, 2007 Whats dope? Its a great answer, exactly what i was looking for.. and quite a quick one at that! Andy 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.