String to array, where 1 element - 1 symbol (letter)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?
  2.  
  3. $str="Hi, All";
  4.  
  5. $arr=preg_split("//", $str,-1,PREG_SPLIT_NO_EMPTY);
  6.  
  7. print $str;
  8. print "<pre>";
  9. print_r($arr);
  10.  
  11.  
  12. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.