Quantcast
Channel: 逝去的青春
Viewing all articles
Browse latest Browse all 34

PHP变量中的变量,代码片段

$
0
0


$ids=array(1,2,3,4);

$sql_mul = "SELECT * FROM `usertable` WHERE `id` IN (" . implode(',', $ids) . ")"; 

 $query_mul = $this->db->query($sql_mul); 

 $row_mul = $query_mul->result_array(); 

 foreach ($row_mul as $k => $val) { 

 $host = $val['host']; 

 ${"row_$host"}[$k] = $val; 

//TODO 变量中添加变量,变量中的变量 

 }

print_r($row_xxx);



Viewing all articles
Browse latest Browse all 34

Trending Articles