i have a string for ex: “2,5,9,12,23,38,39”
what i want to do is have a for loop where i can pull out a number on each pass. so the first pass would be 2, the second pass 5, etc. how would i do this?
[code=php]<?php $string = "2,5,9,12,23,38,39"; $tok = strtok($string, ','); while($tok !== FALSE) { echo $tok."<br />n"; $tok = strtok(','); } ?>[/code]
[code=php] $array = explode(',', "2,5,9,12,23,38,39"); [/code]
Help @ripken204 spread the word by sharing this article on Twitter...