Ich weis nicht genau was du meinst, aber wen ich $typerlaubt ausgebe kommt:
typerlaubt: 0
typerlaubt: 0
typerlaubt: 0
typerlaubt: 5
typerlaubt:
typerlaubt: 0
typerlaubt: 5
typerlaubt: 5
typerlaubt: 5
typerlaubt: 5
typerlaubt: 5
typerlaubt: 5
typerlaubt: 5
typerlaubt: 5
fals der Typ nicht im string vorhanden ist sollte die funktion ja false zurückgeben
...
if($bildtyp)$bildtyp = strtolower($bildtyp);
$typerlaubt = strpos($erlaubteEndungen, $bildtyp);
echo"<br>typerlaubt: $typerlaubt";
...