I have a function which provides a HTML for me. Something like this:
function user_profile ($name, $age, $location){
return "<div class='myclass' style='color:red'>
<span class='title'>user's profile</span>
<ul>
<li>Name: $name</li>
<li>Age: $age</li>
<li>location: $location</li>
</ul>
</div>";
}
echo user_profile ($name, $age, $location);
Function above is a simplified of my real function. In reality, that function has 14 arguments and the HTML is much more longer.
Anyway, I want to know can I make it more clean? I mean, can I make an array of all arguments and just pass it (the array)? In that case how can I use it into the function?
Again, in reality my code is much bigger and the above one is just a sample.
call_user_func_array().