PHP tanımsız indeks hatası

3 Cevap

Please help me again! I have problems with this code:

<?php
  $pathThemes = INC_DIR . "themes";
  $d = dir($pathThemes);
  while (false !== ($entry = $d->read())) {
    $fileInfo = pathinfo($pathThemes . '/' . $entry);

    if ('php' == $fileInfo['extension']) {
      include_once($pathThemes . '/' . $entry);
      $name = $fileInfo['filename'];
      if (!$GLOBALS['fc_config']['themes'][$name]['name']) {
        unset($GLOBALS['fc_config']['themes'][$name]);
      }
    }
  }
?>

Bana diyor ki:

Notice: Undefined index: C adı: \ wamp \ www \ FlashChat_v607 \ sohbet \ inc \ include_themes.php 10 hattı üzerine

Notice: Undefined index: C adı: \ wamp \ www \ FlashChat_v607 \ sohbet \ inc \ include_themes.php 10 hattı üzerine

Notice: Undefined index: C adı: \ wamp \ www \ FlashChat_v607 \ sohbet \ inc \ include_themes.php 10 hattı üzerine

Notice: Undefined index: C adı: \ wamp \ www \ FlashChat_v607 \ sohbet \ inc \ include_themes.php 10 hattı üzerine

3 Cevap

ile değil isset ($ GLOBALS ['fc_config'] ['temalar'] [$ isim] ['name']) kullanmayı deneyin

if (!isset($GLOBALS['fc_config']['themes'][$name]['name'])) {

isset fonksiyonuna bir göz atın

Bu deneyin:

  if (!empty($name) && isset($GLOBALS['fc_config']['themes'][$name]['name'])) {
    unset($GLOBALS['fc_config']['themes'][$name]);
  }