4
Example of the name that is in DB: José Alberto da Silva Nogueira. I’d like you to just show José Nogueira.
<?php if(!Yii::$app->user->isGuest) echo Yii::$app->session->get('nomeUsuario'); ?>
4
Example of the name that is in DB: José Alberto da Silva Nogueira. I’d like you to just show José Nogueira.
<?php if(!Yii::$app->user->isGuest) echo Yii::$app->session->get('nomeUsuario'); ?>
4
Follows code:
if(!Yii::$app->user->isGuest) {
$nomeCompleto = Yii::$app->session->get('nomeUsuario');
$partes = explode(" ", $nomeCompleto);
echo $partes[0] . " " . $partes[count($partes) - 1];
}
Browser other questions tagged php yii
You are not signed in. Login or sign up in order to post.
Thanks for your help Jhonatan.
– Mauro Santos