我想使用我們所稱的C中的結構,但使用PHP,我知道在這裏他們被稱爲類,但我需要使用該類數組對於選擇標籤名,我這樣做如何使用PHP類數組作爲選擇標記的名稱HTML
<?php
class info_subject{
public $code_su;
public $time_su;
public $selecction_su;
}
$subjects= new info_subjects();
$i=0;
//THE DATABASE CONNECTION WORKS FINE, I IGNORED CODING ABOUT DATABASE BECAUSE THAT'S NOT THE
//PROBLEM, JUST FOCUS IN THE STATEMENT OF THE ARRAYS IN THE TAGS NAMES PLEASE
while($line = pg_fetch_array($result, null, PGSQL_NUM))//getting some stuff from postgrest
{
echo "$line[0]";//I am printing this
echo "$line[1]";//I am printing this
//here i am creating selects in every loop with some options, and i want to save the
//result of the selection in the field code_su of the array of classes
echo "<select name=$subjects[$i]->code_su>";
echo "<option value='hola'>hola</option>";
//here i am creating checkbox in every loop, and i want to save the
//result of the checkbox in the field selection_su of the array of classes
echo "<input type='checkbox' name=$subjects[$i]->selection_su>";
$i++;
}
?>
的問題是,它不工作,我想我犯了一個錯誤,在的輸入和選擇名字的聲明,就像我以前說過,我需要一個類數組。
嘗試使用:echo「
@oPi只有英文plz – Justinas 2014-09-22 06:41:38
@Justinas多數民衆贊成什麼即時消息告訴他關於增值稅名稱; – 2014-09-22 06:42:30