PHP How to get first and last name from full name?

PHP How to get first and last name from full name?

December 29, 2022
<?php
$c_name = explode(' ', "Gaurav R Joshi");
echo   $firstName = $c_name[0] ?? '';
echo $lastName = end($c_name);

 

Leave A Comment

Avada Programmer

Hello! We are a group of skilled developers and programmers.

Hello! We are a group of skilled developers and programmers.

We have experience in working with different platforms, systems, and devices to create products that are compatible and accessible.