note 124222 added to language.oop5.autoload
| From: | alhajymoayed at gmail dot com | Date: | Mon, 23 Sep 2019 00:57:19 +0000 |
| Subject: | note 124222 added to language.oop5.autoload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-212333@lists.php.net to get a copy of this message | ||
this function which i program it to autoload class,
only you call function [ autoload_class("dir",".php") ]
or [ autoload_class("dir",".class.php") ]
================
function autoload_class($file,$ext){
for($i=2;$i<count(scandir($file));$i++){
$name= explode(".",scandir($file)[$i])[0];
require $file."/".$name.$ext;
} }
====
i make $i = 2 to remove [ . and ..]
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.168 (proxied: 95.0.219.226)
----
Manual Page -- http://php.net/manual/en/language.oop5.autoload.php
Edit -- https://master.php.net/note/edit/124222
Del: integrated -- https://master.php.net/note/delete/124222/integrated
Del: useless -- https://master.php.net/note/delete/124222/useless
Del: bad code -- https://master.php.net/note/delete/124222/bad+code
Del: spam -- https://master.php.net/note/delete/124222/spam
Del: non-english -- https://master.php.net/note/delete/124222/non-english
Del: in docs -- https://master.php.net/note/delete/124222/in+docs
Del: other reasons-- https://master.php.net/note/delete/124222
Reject -- https://master.php.net/note/reject/124222
Search -- https://master.php.net/manage/user-notes.php