PHP分割字符串

[复制链接]
查看11 | 回复1 | 2009-8-17 19:24:28 | 显示全部楼层 |阅读模式
stress test information :the raw string : '
$str
'"; echo '' , 'function fn_str($str) ' ,''; dump(fn_str($str));echo '' , 'function fn_reg($str) ' ,''; dump(fn_reg($str));}//压力测试function stress_test($str){echo " stress test information :"; $t1 = microtime_float(); fn_reg($str); $t2 = microtime_float(); echo '
  • begin at time : ' , $t1; echo '
  • end at time : ' , $t2; echo ' function : fn_reg() cost ' ,$t2 - $t1, ''; $t3 = microtime_float(); fn_str($str); $t4 = microtime_float();echo '
  • begin at time : ' , $t3; echo '
  • end at time : ' , $t4; echo ' function : fn_str() costs ' ,$t4 - $t3, '';}//获取时间function microtime_float(){
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);}//打印变量function dump($var){echo ''; var_dump($var); echo '';}?>
  • 回复

    使用道具 举报

    千问 | 2009-8-17 19:24:28 | 显示全部楼层
    判断字符还是数字,用一个循环语句,然后进行存储。
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    主题

    0

    回帖

    4882万

    积分

    论坛元老

    Rank: 8Rank: 8

    积分
    48824836
    热门排行