I'm using the following code:
<img src>
<img src>
<img src>
<img src>
<img src>
<?
$thisFile = file_get_contents($_SERVER[SCRIPT_FILENAME]);
$assigned_to[] = preg_match_all("/<img src>/", $thisFile, $matches);
$count=count($assigned_to);
for ($i=0; $i<$count; $i++) {
echo "$assigned_to[$i]";
}
?>
Count it outputting 6 rather then 5 and I can't seem to figure out why. I'm simply trying to count the number of occurances of an html tag. I'm not able to get it to de-increment by 1 in order to show the proper number of tags matched. Any ideas would be appreciated.
Thanks