You are using a string concatenation operator with something that is not a string. Namely, with an array.
Try this:
function href($filename) {
var_dump($HTTP_IMAGE);
var_dump($filename);
if (@$_SERVER['HTTPS'] != 'on') {
return HTTP_IMAGE . $filename;
} else {
return HTTPS_IMAGE . $filename;
}
}
When you run this code it should display whatever is inside HTTPS_IMAGE and $filename.
As I do not know what they contain, I will explain with the following sample code:
$my_array[0] = 'Hello';
$my_array[1] = 'world';
$my_array[2] = '!';
var_dump( $my_array );
If you execute that code you will obtain the following:
array(3) {
[0]=>
string(5) "Hello"
[1]=>
string(5) "world"
[2]=>
string(1) "!"
}
That is an array. It is a collection of elements, which need to be accessed by index. For instance, to access "world" you need to access it by its index, "1":
echo $my_array[1];
Returning to your example, identify which variable is an array and access it by the appropriate index. You will know which index is by inspecting the result of var_dump().
$filename.$filenamevalue?$filename? It's clearly not a string. How are you callinghref()?isset. It andvar_dumpwill be very useful. Suppressing,@,is rarely ideal