三.用list()提取数组
list()函数与array()类似,只是它可以在一次操作中从一个数组内提取多个值,同时为多个变量赋值。其形式如下:
| void list(mixed …) |
| Nino Sanzi|professional golfer|green |
| $users=fopen("user.txt","r"); while($line=fgets($users,4096)){ list($name,$occupation,$color)=explode("|",$line); printf("Name:%s <br/>",$name); printf("Occupation: %s <br />",$occupation); printf("Favorite color: %s <br/>",$color); } fclose($users); |
| Name:http://www.isstudy.com Occupation: Favorite color: |

RSS订阅






