zephir icon indicating copy to clipboard operation
zephir copied to clipboard

Loop through string just like array

Open jimthunderbird opened this issue 10 years ago • 0 comments

Seems like if I split a string to an array and iterate through it by increment the index, it will work.

var strLength, strArr, i;
let strLength =  strlen(str);
let strArr =  str_split(str);
let i = 0;
while (i < strLength) {
   echo strArr[i] . "
";
   let i++;
}

But if I just change strArr to str, it will not work. Will zephir provide support to this soon?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

jimthunderbird avatar Feb 15 '15 03:02 jimthunderbird