At http://www.weberdev.com/get_example-4625.html I found these two
functions:
// get image alt descriptions
function get_image_alt($file){
$h1count = preg_match_all('/(alt=.)([a-zA-Z0-9\s]{1,})/',$file,
$patterns);
$res = array();
array_push($res,$patterns[2]);
array_push($res,count($patterns[2]));
return $res;
}
// retrieve images on the site
function get_images($file){
$h1count = preg_match_all('/(<img)\s (src="([a-zA-Z0-9\.;:\/\?&=_|
\r|\n]{1,})")/isxmU',$file,$patterns);
$res = array();
array_push($res,$patterns[3]);
array_push($res,count($patterns[3]));
return $res;
}
However, I want to list for each image its src and its alt. If an
image has no alt its value could be 'No value'.
Kind regards,
Jan Nordgreen