Friday, January 8, 2010

How to split a string into individual characters using PHP?



In one of our php project, we had to split a string into individual characters. I thought there should be some built-in function for doing this. But I couldn't find the appropriate build-in php function.

Currently we are using below code snippet for doing this split..

for($i=0;$i< strlen($inputstring);$i++){
$letterarray[]=$inputstring[$i];
}


You can let me know thro' the comments if you know any suitable function for doing this task.

More Articles...

1 comment:

Anonymous said...

I can split atoms with less php code.



Thanks for visiting our blog


twitterrss facebook linkedin YouTube subscribe


Subscribe via email

Enter your email address: