Skip to content

Instantly share code, notes, and snippets.



Last active Sep 26, 2018
What would you like to do?
function splitMyName(string $name) {
return explode(' ', $name);
function extractNameFromData(array $data) {
return splitMyName($data['role']);
$data = [
'id' => 110690,
'name' => 'Elias Soares',
'role' => null
$name = extractNameFromData($data);
echo $name[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.