Colleagues ...
I have a method that brings the results of a table. So far so good. What is puzzling me is that after I changed the server, the structure of this method is the same for two other results and works perfectly, but when creating another method with the same structure, it does not return value, except when there is only one value in the bank. I have already copied and pasted the structure of the functional method, replacing only the method name and nothing. But when I echo instead of return, the result appears. Therefore, I have isolated the code in another file and in a simple example, the error appears. Look at a simple function:
function teste(){
for($i = 0; $i < 10; $i++){
$c = $i;
}
return $c;
}
echo teste();
The result appears only 9. But when I give an echo. Returns the values correctly:
function teste(){
for($i = 0; $i < 10; $i++){
$c = $i;
echo $c;
}
}
echo teste();
Does anyone know why this happens?