السلام عليكم ورحمة الله وبركاته ......... كل الذين يعملون في مجال البرمجة يعرفون ما معنى المصفوفة :
int x[10];x[6]=300 ;cout<<x[6]Dim ar(10) As Stringar(6) = 300MsgBox ar(6)
<INPUT TYPE='text' NAME='TextArray[]'><INPUT TYPE='text' NAME='TextArray[]'>
<?phpecho "<FORM METHOD='POST' ACTION=''><INPUT TYPE='text' NAME='TextArray[]'><INPUT TYPE='text' NAME='TextArray[]'><INPUT TYPE='text' NAME='TextArray[]'><INPUT TYPE='submit' value=' Send Control Array'></FORM>";?>
TextArray[0]
TextArray[1]
$_POST[Array name][index]
echo $_POST[TextArray][0]."<br>";echo $_POST[TextArray][1]."<br>";echo $_POST[TextArray][2];
$Arr = $_POST[TextArray];echo $Arr[0]."<br>";echo $Arr[1]."<br>";echo $Arr[2];
sizeof(ArrayName)
echo sizeof($_POST[TextArray]);
for($i = 0; $i < sizeof($_POST[TextArray]); $i++){ echo "<h1>".$_POST[TextArray][$i]."</h1>";}
$a;if(isset($a)){echo "a has a vlaue";}else{echo "a hasn't a value";}
$a =100;if(isset($a)){echo "a has a vlaue";}else{echo "a hasn't a value";}
for($i = 0; $i < sizeof($_POST[TextArray]); $i++){ if(isset($_POST[TextArray][$i])) { echo "<H1>".$_POST[TextArray][$i]."</h1>"; }}
TextArray[0][0]
echo strlen($_POST[TextArray][0]);
for($i = 0; $i < strlen($_POST[TextArray][0]); $i++){echo "<h1>".$_POST[TextArray][0][$i];}
for($i = 0; $i < sizeof($_POST[TextArray]); $i++){ echo "<H1>Element No : $i<br>Value :".$_POST[TextArray][$i]."<br>"; echo "The elements of the element No $i is :<br>"; for($j = 0; $j < strlen($_POST[TextArray][$i]); $j++) { echo $_POST[TextArray][$i][$j]."<br>"; } echo "<hr>";}
VB.Net<INPUT TYPE='checkbox' NAME='CheckBoxArray[]' value='VB.Net'>ASP.Net<INPUT TYPE='checkbox' NAME='CheckBoxArray[]' value='ASP.Net'>Flash MX<INPUT TYPE='checkbox' NAME='CheckBoxArray[]' value='Flash MX'>SQL Server<INPUT TYPE='checkbox' NAME='CheckBoxArray[]' value='SQL Server'>
for($i = 0; $i < sizeof($_POST[CheckBoxArray]); $i++){ echo $_POST[CheckBoxArray][$i];}
echo sizeof($_POST[CheckBoxArray]);
<SELECT NAME='ListBoxArray[]' size='3' MULTIPLE><option>Car</option><option>House</option><option>Education</option></SELECT>
for($i = 0; $i < sizeof($_POST[ListBoxArray]); $i++){ echo $_POST[ListBoxArray][$i]; }
$ar[0]=100;$ar[1]="Dr.pain";$ar[2]=10.2;for($i = 0; $i < sizeof($ar); $i++){echo "<h1>".$ar[$i];}
<FORM METHOD='POST' ACTION='index.php'>SharedArray(Text Box)<INPUT TYPE='text' NAME='SharedArray[]'><br>SharedArray(Check Box)<INPUT TYPE='checkbox' NAME='SharedArray[]' value='SharedArray(Check Box)'><br>SharedArray(Radio)<INPUT TYPE='radio' NAME='SharedArray[]' value='SharedArray(Radio)'><BR>SharedArray(TEXTAREA)<TEXTAREA NAME='SharedArray[]' ROWS='10' COLS='100'></TEXTAREA><BR>SharedArray(Combo Box)<SELECT NAME='SharedArray[]'><Option>car<Option>house<Option>Building</SELECT><BR>SharedArray(List Box)<SELECT NAME='SharedArray[]' size='3' multiple><Option>Blue<Option>Green<Option>Red</SELECT><BR><BR><BR>SharedArray(Button)<INPUT TYPE='submit' value=' Send Control Array' NAME='SharedArray[]'></FORM>
for($i = 0; $i < sizeof($_POST[SharedArray]); $i++){ echo "<h1>".$_POST[SharedArray][$i]."<br>"; }
SharedArray(List Box)<SELECT NAME='SharedArray[]' size='3' multiple><Option>Blue<Option>Green<Option>Red</SELECT>
<?phpecho "<FORM METHOD='POST' ACTION='index.php' name='frmControlArray'><INPUT TYPE='submit' Name='ShowTextArray[]' Value='Hello'> <INPUT TYPE='submit' Name='ShowTextArray[]' Value='World'><INPUT TYPE='' Name='txtHelloWorld'> </FORM>";switch(strtolower($_POST[ShowTextArray][0])){case "hello": echo "Hello"; break;case "world": echo "World";}?>
<script LANGUAGE='JavaScript'>function SetText(Text) { frmControlArray.txtHelloWorld.value=Text; }</SCRIPT>
case "hello": echo "<script LANGUAGE='JavaScript'> SetText('Hello')</SCRIPT> "; break; case "world": echo "<script LANGUAGE='JavaScript'> SetText('World')</SCRIPT> "; break;
<?phpecho "<script LANGUAGE='JavaScript'>function SetText(Text) { frmControlArray.txtHelloWorld.value=Text; }</SCRIPT><FORM METHOD='POST' ACTION='index.php' name='frmControlArray'><INPUT TYPE='submit' Name='ShowTextArray[]' Value='Hello'> <INPUT TYPE='submit' Name='ShowTextArray[]' Value='World'><INPUT TYPE='' Name='txtHelloWorld'> </FORM>";switch(strtolower($_POST[ShowTextArray][0])){case "hello": echo "<script LANGUAGE='JavaScript'> SetText('Hello')</SCRIPT> "; break; case "world": echo "<script LANGUAGE='JavaScript'> SetText('World')</SCRIPT> "; break;}?>
$_POST[]
$_GET[]