A function header looks like this
function doit($theparam){
//$theparam is untrimmed
$theparam = trim($theparam);
//$theparam is now trimmed
}
Is it possible to do the trimming on the first line itself? I tried those 2 but neither worked.
function doit( trim($theparam) ){
//access trimmed version
}
function doit( $theparam = trim($theparam) ){
//access trimmed version
}
I have several functions, all start their work by trimming. If I could do it in fewer lines, I'd be happy.