Posted By

ksnagra on 05/09/11


String loop variable through

Versions (?)

loop through string using PHP

 / Published in: PHP

Simple PHP for loop to display / check each character within a string variable.

  1. $string = "Your String";
  2. for($i=0;$i<strlen($string);$i++){
  3. $char = substr($string,$i,1);
  4. }

Report this snippet  

You need to login to post a comment.