-1
我從數據庫中值:如何打印數組值?
$rows = array();
foreach($results as $result)
{
$rows[] = array(
$result->fe_id,
$result->empcode,
$result->empname,
$result->empphoto,
);
}
和其他功能
function theme_form_example_function($variables)
{
$output ="<h2><pre>".print_r($variables)."</pre></h2>";
return $output;
}
它給我的輸出類似
Array (
[rows] =>
Array (
[0] =>
Array (
[0] => 1
[1] => 12
[2] => sim
[3] => dawn-landscape-mountains-nature-large.jpg
)
[1] =>
Array (
[0] => 2
[1] => EMP13
[2] => simnav
[3] => download-nature-wallpaper-23.jpg
)
)
[theme_hook_original] => form_example_function
)
我想打印輸出:
Empcode: 12 EmpName: Sim Emphot: dawn-landscape-mountains-nature-large.jpg
和第二排:
Empcode: EMP13 EmpName: Simnav Emphot: download-nature-wallpaper-23.jpg
如何使用上述陣列來實現這個輸出?
注意:未初始化字符串偏移量:在theme_form_example_function 1() –
Woops我的壞,更新了答案 –
感謝好友:) –