There's a couple of ways to do it.
Where you have this:
$Data[] = 'Content-URL: <--------->
You can put this:
if ($blah == 'blah') {
$Data[] = 'Content-URL: something';
}
else {
$Data[] = 'Content-URL: anotherthing';
}
Inside a block of code marked by curly brackets like this: { } you can put whatever PHP code you want, including more if statements, or even foreach loops and stuff.
There's another thing you can use that is a bit more specific to the task, called the "ternary operator":
$Data[] = 'Content-URL: '.($blah == 'blah' ? 'something' : 'anotherthing');