I've got what I hope is a simple question. I found some code online at http://icant.co.uk/articles/phpthumbnails/ and I don't understand one of the parameters for the following code:
function createthumb($name,$filename,$new_w,$new_h){
$system=explode('.',$name);
if (preg_match('/jpg|jpeg/',$system[1])){
$src_img=imagecreatefromjpeg($name);
}
if (preg_match('/png/',$system[1])){
$src_img=imagecreatefrompng($name);
}
In the if-statements, what is $system[1]?
PHP gives the following definition for preg_match:
int preg_match ( string pattern, string subject [, array &matches [, int flags [, int offset]]] )
Would $system[1] be the image whose extension I am comparing?
Thanks
Steve