php使用strtok方法拆分字符串
php使用strtok方法拆分字符串 [代码片段(25行)]
<?php <html> <head> <title>Dividing a string into tokens with strtok()</title> </head> <body> <div> <?php $test = 'php?id=353&sec=44&user=harry&context=php'; $delims = '?&'; $word = strtok( $test, $delims ); while ( is_string( $word ) ) { if ( $word ) { print '$word<br/>'; } $word = strtok( $delims ); } ?> </div> </body> </html>
- 上一篇:php数组转换成xml
- 下一篇:PHP图片采集程序
精彩图集
精彩文章