is there a way to write an if else statement by the input field name?
I have a loop that dynamically creates 9 input field,
The loop
for($i=0; $i<($n*$n); $i++){
echo "<tr>";
for($j=0; $j<($n*$n); $j++){
$number = "column".$i.$j;
if($i%$n==0 && $j%$n==0 && $j!==0 && $i!==0){
echo "<td><input class='field' type='text' name=$number value=$_POST[$number]></td>";
}
and the output is this.
<input class="field" type="text" name="column00" value="1">
<input class="field" type="text" name="column01" value="2">
<input class="field" type="text" name="column02" value="1">
.....
<input class="field" type="text" name="column09" value="3">
So what I am trying to do is, that if there is a inputed number on row 1 to 9 that is equal to another number in row 1 to 9 it will echo out that there more than one number thats equal to each other.
I tried something like this but it wouldn't work.
if($number==$number){
echo = "equal number in the same row";
}