Prova come ha detto luke con i valori boolean..
Codice PHP:
for ($x = 0; $x <= count($final_links); $x++)
{
// The script checks if the $ is empty
if (!empty($final_links[$x])){
// The script checks if the string contains 'http://'
if(substr_count($final_links[$x], 'http://') != "1"){
$true = 0;
}
else{
// Tutto questo codice funziona perfettamente
$true = 1; // Creo variabile con valore 1, giusto no?
}
}
else{
$true = 0;
}
}
if($true != 0){
echo "Diverso da 0";
}else{
echo "Uguale a 0";
}
O con true e false..
Codice PHP:
for ($x = 0; $x <= count($final_links); $x++)
{
// The script checks if the $ is empty
if (!empty($final_links[$x])){
// The script checks if the string contains 'http://'
if(substr_count($final_links[$x], 'http://') != "1"){
$true = false;
}
else{
// Tutto questo codice funziona perfettamente
$true = true; // Creo variabile con valore 1, giusto no?
}
}
else{
$true = false;
}
}
if($true === true){
echo "Diverso da 0";
}else{
echo "Uguale a 0";
}