Truncate nickname

15 years 11 months ago #52567 by bugs_budy
Truncate nickname was created by bugs_budy

I want to truncate user nickname

By searching on the web I found a function to truncate a text:

function Truncate_Text($text, $max_lenght)
if (strlen($text) > $max_lenght)
$text = substr($text, 0, $max_lenght);
$last_space = strrpos($text, "");
$text = substr($text, 0, $last_space)."...";

return $text;

echo Truncate_Text("Your example text", 20);

If the Joomla's variable which returns the nickname was as simple as "$text", I could make the change myself, but like the variable is."$ This-> _s4j-> GetUser ($ row) . "my skills in php I am unable to change the script.

Someone there can help me?

Thank you very much

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.133 seconds

Facebook Twitter LinkedIn