I'm not really sure what this is called or how to search for it so hopefully this hasn't been asked too many times before.
Is it possible to pass a variable to a function inside the function variable thing... I know that doesn't make sense, so here is an example:
sendContact('Firstname Lastname', $email, $address);
function sendContact(splitWord($name), $email, $address) {
//code here
print_r($name);
//result array[0] = 'Firstname';
//result array[1] = 'Lastname';
}
function splitWord($name) {
//code here to split words
return $result
}
All I'm looking for is the sendContact(splitWord()) part. Is there a way to do that as that doesn't seem to work.