Wolfgang Hebenstreit: PHPwie schreibe ich eine If und else bedingung

Beitrag lesen

»»Hallo Alexander

Sorry ich bin noch neu!
Was stimmt hier nicht?

»»<?PHP
»»$bild = "bild2";
»»$datei = "bild.jpg";
»»if(file_exists($datei))
»»
»» if ($datei > "")
»»{

?>
   <img src="<?php echo $datei ?>">
   <?php

»»}
»»
»»else  ($bild > "")
»»{

?>
  <img src="<?php echo $bild ?>">
  <?php

»»}
»»?>

mfg Wolfi

Die If Anweisung geht aber die else nicht.