Split User Name to first and last name

Sorry if this has been answered before guys but I can't find an answer

I have an element xfco_introductions___intro_referrer_name which pulls in the logged in user's name from Joomla successfully e.g. John Smith

I want to add a calc field that splits the Fullname element above and just returns the first name in this element called xfco_introductions___intro_referrer_first_name e.g. John

Can someone please help
 
You can use string manipulation or convert to array and catch the first one. Something like this :
Code:
return explode(' ', '{xfco_introductions___intro_referrer_name}')[0];
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top