I do not know why you put the "or" but if it's only with if else, then you could do something like this:
I clarify something, I do not know if they told you that you can nest the if / else, so I will do it without nesting them.
<?php
$numm=array();
$numm[0]=1;
$numm[1]=2;
$numm[2]=3;
if(($numm[0]==$numm[1]) && ($numm[0]==$numm[2])){
echo "Todos los numeros son iguales";
}
if(($numm[0]<$numm[1]) && ($numm[0]<$numm[2])){
echo "El menor de los numeros es ".$numm[0];
}
if(($numm[0]<$numm[1]) && ($numm[0]==$numm[2])){
echo "Hay dos numeros menores iguales a: ".$numm[0];
}
if(($numm[0]==$numm[1]) && ($numm[0]<$numm[2])){
echo "Hay dos numeros menores iguales a: ".$numm[0];
}
if(($numm[1]<$numm[0]) && ($numm[1]<$numm[2])){
echo "El menor de los numeros es ".$numm[1];
}
if(($numm[1]<$numm[0]) && ($numm[1]==$numm[2])){
echo "Hay dos numeros menores iguales a: ".$numm[1];
}
if(($numm[2]<$numm[0]) && ($numm[2]<$numm[1])){
echo "El menor de los numeros es ".$numm[2];
}
?>
Corrections to your code:
$numm2[1]=2;
$numm3[2]=3;
By:
$numm[1]=2;
$numm[2]=3;
Reason:
There are no arrays numm2 and numm1
This part:
$numm=array();
$numm[0]=1;
$numm[1]=2;
$numm[2]=3;
It can be changed by this, since it is basically the same:
$numm=array(1,2,3);
And I change the or
(you should have put ||
since that is the or
in php) that you used for &&
(and) and check all the possible cases.
I explain to you every if:
If everyone is the same:
if(($numm[0]==$numm[1]) && ($numm[0]==$numm[2])){
echo "Todos los numeros son iguales";
}
If the first number is the smallest:
if(($numm[0]<$numm[1]) && ($numm[0]<$numm[2])){
echo "El menor de los numeros es ".$numm[0];
}
If the first and the third are equal and are the minor ones:
if(($numm[0]<$numm[1]) && ($numm[0]==$numm[2])){
echo "Hay dos numeros menores iguales a: ".$numm[0];
}
If the first and second are the same and are the least:
if(($numm[0]==$numm[1]) && ($numm[0]<$numm[2])){
echo "Hay dos numeros menores iguales a: ".$numm[0];
}
If the second is the least of all:
if(($numm[1]<$numm[0]) && ($numm[1]<$numm[2])){
echo "El menor de los numeros es ".$numm[1];
}
If the second and third are equal and are the minor ones:
if(($numm[1]<$numm[0]) && ($numm[1]==$numm[2])){
echo "Hay dos numeros menores iguales a: ".$numm[1];
}
If the third party is the youngest of all:
if(($numm[2]<$numm[0]) && ($numm[2]<$numm[1])){
echo "El menor de los numeros es ".$numm[2];
}