I have a function with 5 arguments and default site width variable
$site_width ='1000px';
function MyPrintFunction ($divName,$width=false,$html1='',$html2='', $echo = true ){
... plenty of code above, no need to post complete function
$html = '<div id="'.$divName.'">';
$html .= '</div>';
if( $echo ){
echo $html1.$html.$html2;
}else{
return $html1.$html.$html2;
}
}
and than I print html like:
MyPrintFunction ('divname1',true);
MyPrintFunction ('divname2');
MyPrintFunction ('divname3');
I need to check if any of these functions has set the second argument to true, and if yes , I need first argument name.
This way I can add the argument name to css snippet ( will be injected in head later ) and set width for it
#ARrument1NameSHouldGoHereAsVariable{
width:$site_width;
}
I hope I explained this right. Sorry if I did not. Any help is appreciated. Thank you!