请高手帮我看看能不能简化程序? for($i=0;i<strlen($str);$i++){ if($str{$i} == "0") { 写数据表.... }} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 定义一个数组,内容大体上是 $test_array = array( "TABLE1", "TABLE2", "TABLE3", "TABLE4", "TABLE5", "TABLE6",);在对那个表进行操作的时候就能得到他的KEY然后在从$str{}修改不就玩了! 我这样想的不知道可不可以,就是比如0000000,先取出为0的位置,比如是第几位为零,有一个数组代表位置对应的表,然后循环这个数组,对相应的表进行操作。$arr = array("1" => "table1", "2" => "table2","3" => "table3");我对数组操作不怎么熟悉,想法有了不知道怎么实施 $str="10000";$arr = array("0"=>"table","1" => "table1", "2" => "table2","3" => "table3");for($i=0;i<strlen($str);$i++){ if($str{$i} == "1") { $table=$arr[$i]; $insert="select * from $table"; echo $insert; }}但是太慢了执行,Fatal error: Maximum execution time of 30 seconds exceeded in c:\AppServ\www\51\del.php on line 17 2000条数据的数组,找到有重复值的索引. 删除目录问题 [分享]php下memcached模块使用crc的一个bug及libmemcached一致性哈希算法分析 关于读取网页的内容? PHP与MYSQL编码统一问题 求教 PHP+mssql+utf-8(韩文 维文 ……) 各位高手,问一个菜鸟级问题! 我想让php 支持mssql 应该怎么做 花钱找人调试一个PHP MYSQL程序 关于unixstamp的问题?有请各路高手,绝对不简单的问题 [新手问题]在php里面怎么响应事件? 求 PHP命令函数集
$test_array = array(
"TABLE1",
"TABLE2",
"TABLE3",
"TABLE4",
"TABLE5",
"TABLE6",
);
在对那个表进行操作的时候就能得到他的KEY然后在从$str{}修改不就玩了!
$arr = array("0"=>"table","1" => "table1", "2" => "table2","3" => "table3");
for($i=0;i<strlen($str);$i++)
{
if($str{$i} == "1")
{ $table=$arr[$i];
$insert="select * from $table";
echo $insert;
}
}但是太慢了执行,Fatal error: Maximum execution time of 30 seconds exceeded in c:\AppServ\www\51\del.php on line 17