Answers for "php iterate a string"

PHP
3

php foreach string char

//Split int char array
$chars = str_split($str);

//Loop each char
foreach($chars as $char)
{
    // your code
}
Posted by: Guest on March-23-2020
0

php iterate through a loop

<?php
 
$scores = [1,2,3];
foreach ($scores as $score) {
 echo $score;
}
Posted by: Guest on April-26-2020

Browse Popular Code Answers by Language