I have a simple problem and I do not want to write 24 if statements.
I am creating a URL string which requires precise formatting to work. This URL is getting created on the fly based on variables ($Layer1.','.$Layer2.','.$Layer3)
I pass in to create the URL string. The URL string requires a format like this:
http://test/map.php5?LAYERS=Layer1,Layer2,Layer3&QUERY_LAYERS=Layer1,Layer2,Layer3
The problem lies when I only pass lets say two of the variables. My URL now looks like:
http://test/map.php5?LAYERS=,Layer2,Layer3&QUERY_LAYERS=,Layer2,Layer3
The application accepting this URL is certainly not happing with a leading comma.
FYI - Variables declared as follows:
$Layer1="Layer1";
$Layer2="Layer2";
$Layer3="Layer3";
Any idea how I can get this to work without testing every possible combination?
Thanks in advance,
Mapper