-2
I made these two functions very simple to limit the characters and to see if the column in the empty database, for some reason only returns empty even having results.
public function limite_texto($texto, $limite, $complemento) {
return mb_strimwidth(utf8_encode($texto), 0, $limite, $complemento);
}
public function vazio($texto, $limite, $complemento, $aviso) {
if (empty($texto)) :
return $aviso;
else :
return $this->limite_texto($texto, $limite, $complemento);
endif;
}
$ctlr->vazio("oooooi", 3, "...", "O campo está vazio")
For some reason ta returning only the "...", when the expected would be "Ooo..." or if the variable $texto
were empty to return O campo está vazio
, I think I made a mistake in logic
The intention was to make this function add the "3 dots" limiting the number of characters only of the variable
$texto
– goio