Skip to content

Instantly share code, notes, and snippets.

@iget-esoares iget-esoares/index.php
Last active Sep 26, 2018

Embed
What would you like to do?
<?php
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.