-Edward-
09-26-2007, 11:54 AM
Hi Folks,
I'm having a little trouble breaking down this array:
$images = array
(
'44' => 'img.gif',
'45' => 'file.swf',
);
This is inside a function called GetMy.
I've created another function that I want to grab the final 3 letters of what the array displays.
So, if it ends in .gif it displays:
This is an image
and if it ends in .swf it displays:
This is a flash movie
Here's my function:
function wts( ) {
$get = GetMy();
$display = substr($get, 0, 3);
if ($display = "gif") {
echo "Its a gif image";
} else {
echo "Its a flash movie";
}
}
It shows the following though:
img.gif img.gifIts a gif image
Whether it's an img or an swf file, Can anyone help?
I'm having a little trouble breaking down this array:
$images = array
(
'44' => 'img.gif',
'45' => 'file.swf',
);
This is inside a function called GetMy.
I've created another function that I want to grab the final 3 letters of what the array displays.
So, if it ends in .gif it displays:
This is an image
and if it ends in .swf it displays:
This is a flash movie
Here's my function:
function wts( ) {
$get = GetMy();
$display = substr($get, 0, 3);
if ($display = "gif") {
echo "Its a gif image";
} else {
echo "Its a flash movie";
}
}
It shows the following though:
img.gif img.gifIts a gif image
Whether it's an img or an swf file, Can anyone help?
