۱ mohammad dadkhah
کلاس وجود ندارد
جامعه پی اچ پی ایجاد شده در ۰۵ اردیبهشت ۱۴۰۱

سلام لطفا به عکس زیر توجه کنید مشابه فیلم‌ها رفتم جلو جواب نداد بعد اومدم در className از ادرس کامل استفاده کرده ام باز هم میگه همچنین کلاس ای وجود ندارد

0f9f-image.png

<?php
spl_autoload_register(function($class){
    $class_file="/var/www/html/Google_contact/inc/$class.php";
    if (file_exists($class_file) and is_readable($class_file)) {
      include $class_file;
    }else {
        die("class load Error");
    }
});

,

<?php
namespace Exporter;
class TextExporter extends Exporter 
{
    protected $format='.txt';
    public function export()
    {
        $filePath= "/var/www/html/Google_contact/inc/Files/";
        $nameFile= $filePath.'Contacts - '.date("y-m-d h:i:s").$this->format;
        file_put_contents($nameFile,"{$this->data['title']}\\n{$this->data['content']}");
        echo $nameFile."successifull created!";
       //var_dump($this->data);
    }
}

سلام دوست عزیز

پروژتون رو زیپ کنید بررسی کنم

محمد گازری ۰۵ اردیبهشت ۱۴۰۱، ۱۳:۵۵