Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to traverse characters in a string in a for loop in php

<?php
$str = "apple";
 
$length = strlen($str);
for ($index = 0; $index < $length; $index++) {
    echo $str[$index];
    echo "<br>";
}
?>
Source by www.tutorialkart.com #
 
PREVIOUS NEXT
Tagged: #traverse #characters #string #loop #php
ADD COMMENT
Topic
Name
2+7 =