A simple PHP method to split a string and output it in a loop. You can refer to the study notebook.
Example 1
代码如下 | 复制代码 |
$test='472347127,893372115,850965403'; $r=explode(",",$test); for($i=0;$i ?> |
Output: 0.472347127 1.893372115 2.850965403
Example 2
代码如下 | 复制代码 |
$a="893372115,472347127,850965403" ; $b=explode(",",$a); foreach($b as $bb) { echo $bb.""; //print_r($b); } ?> |
Output: 893372115 472347127 850965403 PHP
Loop to read array variable values, similar to the usage of Split in ASP